Make WordPress Core


Ignore:
Timestamp:
09/20/2016 09:38:08 PM (8 years ago)
Author:
jeremyfelt
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/option.php

    r38388 r38636  
    10711071 *
    10721072 * @global wpdb   $wpdb
     1073 * @global object $current_site
    10731074 *
    10741075 * @param int      $network_id ID of the network. Can be null to default to the current network ID.
     
    10781079 */
    10791080function get_network_option( $network_id, $option, $default = false ) {
    1080     global $wpdb;
     1081    global $wpdb, $current_site;
    10811082
    10821083    if ( $network_id && ! is_numeric( $network_id ) ) {
     
    10881089    // Fallback to the current network if a network ID is not specified.
    10891090    if ( ! $network_id && is_multisite() ) {
    1090         $network_id = get_current_site()->id;
     1091        $network_id = $current_site->id;
    10911092    }
    10921093
     
    11871188 *
    11881189 * @global wpdb   $wpdb
     1190 * @global object $current_site
    11891191 *
    11901192 * @param int    $network_id ID of the network. Can be null to default to the current network ID.
     
    11941196 */
    11951197function add_network_option( $network_id, $option, $value ) {
    1196     global $wpdb;
     1198    global $wpdb, $current_site;
    11971199
    11981200    if ( $network_id && ! is_numeric( $network_id ) ) {
     
    12041206    // Fallback to the current network if a network ID is not specified.
    12051207    if ( ! $network_id && is_multisite() ) {
    1206         $network_id = get_current_site()->id;
     1208        $network_id = $current_site->id;
    12071209    }
    12081210
     
    12961298 *
    12971299 * @global wpdb   $wpdb
     1300 * @global object $current_site
    12981301 *
    12991302 * @param int    $network_id ID of the network. Can be null to default to the current network ID.
     
    13021305 */
    13031306function delete_network_option( $network_id, $option ) {
    1304     global $wpdb;
     1307    global $wpdb, $current_site;
    13051308
    13061309    if ( $network_id && ! is_numeric( $network_id ) ) {
     
    13121315    // Fallback to the current network if a network ID is not specified.
    13131316    if ( ! $network_id && is_multisite() ) {
    1314         $network_id = get_current_site()->id;
     1317        $network_id = $current_site->id;
    13151318    }
    13161319
     
    13771380 *
    13781381 * @global wpdb   $wpdb
     1382 * @global object $current_site
    13791383 *
    13801384 * @param int      $network_id ID of the network. Can be null to default to the current network ID.
     
    13841388 */
    13851389function update_network_option( $network_id, $option, $value ) {
    1386     global $wpdb;
     1390    global $wpdb, $current_site;
    13871391
    13881392    if ( $network_id && ! is_numeric( $network_id ) ) {
     
    13941398    // Fallback to the current network if a network ID is not specified.
    13951399    if ( ! $network_id && is_multisite() ) {
    1396         $network_id = get_current_site()->id;
     1400        $network_id = $current_site->id;
    13971401    }
    13981402
Note: See TracChangeset for help on using the changeset viewer.