Skip to content

Instantly share code, notes, and snippets.

@jayarjo
Last active December 29, 2015 04:19
Show Gist options
  • Save jayarjo/7614316 to your computer and use it in GitHub Desktop.
Save jayarjo/7614316 to your computer and use it in GitHub Desktop.
wp: do not update specific plugin (handy when it's modified)
add_filter( 'http_request_args', 'eshop_prevent_update_check', 10, 2 );
function eshop_prevent_update_check( $r, $url )
{
if ( false !== strpos( $url, 'api.wordpress.org/plugins/update-check/' ) ) {
$my_plugin = plugin_basename( __FILE__ );
$plugins = unserialize( $r['body']['plugins'] );
unset( $plugins->plugins[$my_plugin] );
unset( $plugins->active[array_search( $my_plugin, $plugins->active )] );
$r['body']['plugins'] = serialize( $plugins );
}
return $r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment