我找到了一个解决办法。创建一个插件,在网络范围内激活。这对于mu安装非常重要。如果检查只在插件中进行,那么mu安装的博客中有活动的,那么检查只在该博客中进行,更新检查和通知在网络中进行。
定义插件,您将不会在var数组中检查更新$blocked_plugins
.
<?php
/**
* Plugin Name: Plugin updates blocker
* Plugin URI:
* Description: Disable plugin update check for specific plugins list
* Version: 1.0.0
* Author: Frank Bültge
* Author URI: http://bueltge.de
* License: GPLv3
*/
! defined( \'ABSPATH\' ) and exit;
add_filter( \'http_request_args\', \'fb_block_update_specific_plugins\', 5, 2 );
function fb_block_update_specific_plugins( $r, $url ) {
//var_dump( unserialize( $r[\'body\'][\'plugins\'] ) );
if ( 0 !== strpos( $url, \'http://api.wordpress.org/plugins/update-check\' ) )
return $r;
// array for the plugin slug - folder/file
$blocked_plugins = array(
\'oembed-gist.php\', // plugin without folder
\'subtitle/class-post_subtitle.php\',
\'wp-slabText/wp-slabtext.php\',
);
if ( 0 === (int) count( $blocked_plugins ) )
return $r;
$installed_plugins = unserialize( $r[\'body\'][\'plugins\'] );
foreach( $blocked_plugins as $p ) {
unset( $installed_plugins->plugins[ $p ] );
unset( $installed_plugins->active[ array_key_exists( $p, $installed_plugins ) ] );
}
$r[\'body\'][\'plugins\'] = serialize( $installed_plugins );
return $r;
}