MS: Use *_network_option() functions throughout core.
Replaces all uses of `*_site_option()` with the corresponding "network" function. This excludes one usage in `wp-admin/admin-footer.php` that needs more investigation. Props spacedmonkey. See #28290. Built from https://develop.svn.wordpress.org/trunk@34778 git-svn-id: http://core.svn.wordpress.org/trunk@34743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -88,7 +88,7 @@ function get_option( $option, $default = false ) {
|
||||
wp_cache_add( $option, $value, 'options' );
|
||||
} else { // option does not exist, so we must cache its non-existence
|
||||
if ( ! is_array( $notoptions ) ) {
|
||||
$notoptions = array();
|
||||
$notoptions = array();
|
||||
}
|
||||
$notoptions[$option] = true;
|
||||
wp_cache_set( 'notoptions', $notoptions, 'options' );
|
||||
@@ -1466,9 +1466,9 @@ function delete_site_transient( $transient ) {
|
||||
} else {
|
||||
$option_timeout = '_site_transient_timeout_' . $transient;
|
||||
$option = '_site_transient_' . $transient;
|
||||
$result = delete_site_option( $option );
|
||||
$result = delete_network_option( $option );
|
||||
if ( $result )
|
||||
delete_site_option( $option_timeout );
|
||||
delete_network_option( $option_timeout );
|
||||
}
|
||||
if ( $result ) {
|
||||
|
||||
@@ -1529,16 +1529,16 @@ function get_site_transient( $transient ) {
|
||||
$transient_option = '_site_transient_' . $transient;
|
||||
if ( ! in_array( $transient, $no_timeout ) ) {
|
||||
$transient_timeout = '_site_transient_timeout_' . $transient;
|
||||
$timeout = get_site_option( $transient_timeout );
|
||||
$timeout = get_network_option( $transient_timeout );
|
||||
if ( false !== $timeout && $timeout < time() ) {
|
||||
delete_site_option( $transient_option );
|
||||
delete_site_option( $transient_timeout );
|
||||
delete_network_option( $transient_option );
|
||||
delete_network_option( $transient_timeout );
|
||||
$value = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! isset( $value ) )
|
||||
$value = get_site_option( $transient_option );
|
||||
$value = get_network_option( $transient_option );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1593,14 +1593,14 @@ function set_site_transient( $transient, $value, $expiration = 0 ) {
|
||||
} else {
|
||||
$transient_timeout = '_site_transient_timeout_' . $transient;
|
||||
$option = '_site_transient_' . $transient;
|
||||
if ( false === get_site_option( $option ) ) {
|
||||
if ( false === get_network_option( $option ) ) {
|
||||
if ( $expiration )
|
||||
add_site_option( $transient_timeout, time() + $expiration );
|
||||
$result = add_site_option( $option, $value );
|
||||
add_network_option( $transient_timeout, time() + $expiration );
|
||||
$result = add_network_option( $option, $value );
|
||||
} else {
|
||||
if ( $expiration )
|
||||
update_site_option( $transient_timeout, time() + $expiration );
|
||||
$result = update_site_option( $option, $value );
|
||||
update_network_option( $transient_timeout, time() + $expiration );
|
||||
$result = update_network_option( $option, $value );
|
||||
}
|
||||
}
|
||||
if ( $result ) {
|
||||
@@ -1631,4 +1631,4 @@ function set_site_transient( $transient, $value, $expiration = 0 ) {
|
||||
do_action( 'setted_site_transient', $transient, $value, $expiration );
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user