Skip to content

Instantly share code, notes, and snippets.

@benhuson
Created January 11, 2013 10:52
Show Gist options
  • Save benhuson/4509762 to your computer and use it in GitHub Desktop.
Save benhuson/4509762 to your computer and use it in GitHub Desktop.
Hide plugin update messages for a WordPress plugin
<?php
/**
* Hide Plugin Update Messages for this plugin
*/
add_filter( 'http_request_args', 'hide_plugin_update_messages', 10, 2 );
function hide_plugin_update_messages( $r, $url ) {
if ( 0 === strpos( $url, 'http://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