尝试以下操作:
add_filter( \'http_request_args\', \'dm_prevent_update_check\', 10, 2 );
function dm_prevent_update_check( $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;
}
学分:
https://stackoverflow.com/questions/17897044/wordpress-how-to-disable-plugin-update