document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2. // This must be in the same file as your main plugin file which WordPress uses to determine plugin name, plugin version etc.
  3. global $sMyUniquePluginBaseFile;
  4. $sMyUniquePluginBaseFile = plugin_basename( __FILE__ );
  5.  
  6. add_filter( \'auto_update_plugin\', \'onWpAutoUpdatePlugin\', 100, 2 );
  7.  
  8. /**
  9.  * @param boolean $fUpdate
  10.  * @param object $oPluginInfo
  11.  * @return bool
  12.  */
  13. function onWpAutoUpdatePlugin( $fUpdate, $oPluginInfo ) {
  14.  
  15.     // Only supports WordPress 3.8.2+
  16.     if ( !is_object( $oPluginInfo ) || !isset( $oPluginInfo->new_version ) || !isset( $oPluginInfo->plugin ) )  { // WP 3.8.2+
  17.         return $fUpdate;
  18.     }
  19.  
  20.     // Verify that this is MY plugin
  21.     global $sMyUniquePluginBaseFile;
  22.     if ( $oPluginInfo->plugin === $sMyUniquePluginBaseFile ) {
  23.    
  24.         // You need logic in here that determines that this plugin update is MINOR.
  25.         // e.g.
  26.         $sCurrentVersion = getCurrentPluginMajorVersionNumber();
  27.         $sUpdateVersion = getNewUpdateMajorVersionNumber( $oPluginInfo->new_version );
  28.        
  29.         // We only return true (i.e. update) only if the major versions are UNCHANGED - so it must be a minor version update
  30.         return ( $sCurrentVersion === $sUpdateVersion );
  31.     }
  32.     return $fUpdate;
  33. }
');