mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Multisite: Revert [38388].
Restore `get_current_site()` to a multisite only function. Providing this in single site may be a possibility in the future, but should have a dedicated ticket and discussion. See #37699. git-svn-id: https://develop.svn.wordpress.org/trunk@38636 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1070,6 +1070,7 @@ function update_site_option( $option, $value ) {
|
||||
* @see get_option()
|
||||
*
|
||||
* @global wpdb $wpdb
|
||||
* @global object $current_site
|
||||
*
|
||||
* @param int $network_id ID of the network. Can be null to default to the current network ID.
|
||||
* @param string $option Name of option to retrieve. Expected to not be SQL-escaped.
|
||||
@@ -1077,7 +1078,7 @@ function update_site_option( $option, $value ) {
|
||||
* @return mixed Value set for the option.
|
||||
*/
|
||||
function get_network_option( $network_id, $option, $default = false ) {
|
||||
global $wpdb;
|
||||
global $wpdb, $current_site;
|
||||
|
||||
if ( $network_id && ! is_numeric( $network_id ) ) {
|
||||
return false;
|
||||
@@ -1087,7 +1088,7 @@ function get_network_option( $network_id, $option, $default = false ) {
|
||||
|
||||
// Fallback to the current network if a network ID is not specified.
|
||||
if ( ! $network_id && is_multisite() ) {
|
||||
$network_id = get_current_site()->id;
|
||||
$network_id = $current_site->id;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1186,6 +1187,7 @@ function get_network_option( $network_id, $option, $default = false ) {
|
||||
* @see add_option()
|
||||
*
|
||||
* @global wpdb $wpdb
|
||||
* @global object $current_site
|
||||
*
|
||||
* @param int $network_id ID of the network. Can be null to default to the current network ID.
|
||||
* @param string $option Name of option to add. Expected to not be SQL-escaped.
|
||||
@@ -1193,7 +1195,7 @@ function get_network_option( $network_id, $option, $default = false ) {
|
||||
* @return bool False if option was not added and true if option was added.
|
||||
*/
|
||||
function add_network_option( $network_id, $option, $value ) {
|
||||
global $wpdb;
|
||||
global $wpdb, $current_site;
|
||||
|
||||
if ( $network_id && ! is_numeric( $network_id ) ) {
|
||||
return false;
|
||||
@@ -1203,7 +1205,7 @@ function add_network_option( $network_id, $option, $value ) {
|
||||
|
||||
// Fallback to the current network if a network ID is not specified.
|
||||
if ( ! $network_id && is_multisite() ) {
|
||||
$network_id = get_current_site()->id;
|
||||
$network_id = $current_site->id;
|
||||
}
|
||||
|
||||
wp_protect_special_option( $option );
|
||||
@@ -1295,13 +1297,14 @@ function add_network_option( $network_id, $option, $value ) {
|
||||
* @see delete_option()
|
||||
*
|
||||
* @global wpdb $wpdb
|
||||
* @global object $current_site
|
||||
*
|
||||
* @param int $network_id ID of the network. Can be null to default to the current network ID.
|
||||
* @param string $option Name of option to remove. Expected to not be SQL-escaped.
|
||||
* @return bool True, if succeed. False, if failure.
|
||||
*/
|
||||
function delete_network_option( $network_id, $option ) {
|
||||
global $wpdb;
|
||||
global $wpdb, $current_site;
|
||||
|
||||
if ( $network_id && ! is_numeric( $network_id ) ) {
|
||||
return false;
|
||||
@@ -1311,7 +1314,7 @@ function delete_network_option( $network_id, $option ) {
|
||||
|
||||
// Fallback to the current network if a network ID is not specified.
|
||||
if ( ! $network_id && is_multisite() ) {
|
||||
$network_id = get_current_site()->id;
|
||||
$network_id = $current_site->id;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1376,6 +1379,7 @@ function delete_network_option( $network_id, $option ) {
|
||||
* @see update_option()
|
||||
*
|
||||
* @global wpdb $wpdb
|
||||
* @global object $current_site
|
||||
*
|
||||
* @param int $network_id ID of the network. Can be null to default to the current network ID.
|
||||
* @param string $option Name of option. Expected to not be SQL-escaped.
|
||||
@@ -1383,7 +1387,7 @@ function delete_network_option( $network_id, $option ) {
|
||||
* @return bool False if value was not updated and true if value was updated.
|
||||
*/
|
||||
function update_network_option( $network_id, $option, $value ) {
|
||||
global $wpdb;
|
||||
global $wpdb, $current_site;
|
||||
|
||||
if ( $network_id && ! is_numeric( $network_id ) ) {
|
||||
return false;
|
||||
@@ -1393,7 +1397,7 @@ function update_network_option( $network_id, $option, $value ) {
|
||||
|
||||
// Fallback to the current network if a network ID is not specified.
|
||||
if ( ! $network_id && is_multisite() ) {
|
||||
$network_id = get_current_site()->id;
|
||||
$network_id = $current_site->id;
|
||||
}
|
||||
|
||||
wp_protect_special_option( $option );
|
||||
|
||||
Reference in New Issue
Block a user