Advertisement
websupporter

Hook into the plugin update process of WordPress part III

Jun 3rd, 2015
770
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. function auv_plugin_api( $false, $action, $arg ){
  2.     if (isset($arg->slug) && $arg->slug === plugin_basename( __FILE__ ) ) {
  3.         $request = wp_remote_get( 'http://websupporter.net/current-version.php' );
  4.         if (!is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) === 200 ) {
  5.             return unserialize( $request['body'] );
  6.         }
  7.         return false;
  8.  
  9.     }
  10. }
  11. add_filter( 'plugins_api', 'auv_plugin_api', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement