Revert [34778], continue using _site_option() for the current network.

The `_network_option()` parameter order will be changing to accept `$network_id` first. The `_site_option()` functions will remain in use throughout core as our way of retrieving a network option for the current network.

See #28290.


git-svn-id: https://develop.svn.wordpress.org/trunk@34912 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt
2015-10-07 17:11:01 +00:00
parent 9a704fa0b8
commit 599fb50e09
35 changed files with 192 additions and 192 deletions

View File

@@ -462,7 +462,7 @@ function is_plugin_active_for_network( $plugin ) {
if ( !is_multisite() )
return false;
$plugins = get_network_option( 'active_sitewide_plugins' );
$plugins = get_site_option( 'active_sitewide_plugins');
if ( isset($plugins[$plugin]) )
return true;
@@ -520,7 +520,7 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
if ( is_multisite() && ( $network_wide || is_network_only_plugin($plugin) ) ) {
$network_wide = true;
$current = get_network_option( 'active_sitewide_plugins', array() );
$current = get_site_option( 'active_sitewide_plugins', array() );
$_GET['networkwide'] = 1; // Back compat for plugins looking for this value.
} else {
$current = get_option( 'active_plugins', array() );
@@ -573,9 +573,9 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
}
if ( $network_wide ) {
$current = get_network_option( 'active_sitewide_plugins', array() );
$current = get_site_option( 'active_sitewide_plugins', array() );
$current[$plugin] = time();
update_network_option( 'active_sitewide_plugins', $current );
update_site_option( 'active_sitewide_plugins', $current );
} else {
$current = get_option( 'active_plugins', array() );
$current[] = $plugin;
@@ -624,7 +624,7 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
*/
function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
if ( is_multisite() )
$network_current = get_network_option( 'active_sitewide_plugins', array() );
$network_current = get_site_option( 'active_sitewide_plugins', array() );
$current = get_option( 'active_plugins', array() );
$do_blog = $do_network = false;
@@ -705,7 +705,7 @@ function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
if ( $do_blog )
update_option('active_plugins', $current);
if ( $do_network )
update_network_option( 'active_sitewide_plugins', $network_current );
update_site_option( 'active_sitewide_plugins', $network_current );
}
/**
@@ -877,7 +877,7 @@ function validate_active_plugins() {
}
if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) {
$network_plugins = (array) get_network_option( 'active_sitewide_plugins', array() );
$network_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
$plugins = array_merge( $plugins, array_keys( $network_plugins ) );
}