Make WordPress Core


Ignore:
Timestamp:
08/26/2016 09:34:36 PM (10 years ago)
Author:
wonderboymusic
Message:

Multisite: move get_current_site() to load.php so that it can be used in more places, instead of importing global $current_site.

See #37699.

File:
1 edited

Legend:

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

    r38334 r38388  
    10711071 *
    10721072 * @global wpdb   $wpdb
    1073  * @global object $current_site
    10741073 *
    10751074 * @param int      $network_id ID of the network. Can be null to default to the current network ID.
    … …  
    10791078 */
    10801079function get_network_option( $network_id, $option, $default = false ) {
    1081         global $wpdb, $current_site;
     1080        global $wpdb;
    10821081
    10831082        if ( $network_id && ! is_numeric( $network_id ) ) {
    … …  
    10891088        // Fallback to the current network if a network ID is not specified.
    10901089        if ( ! $network_id && is_multisite() ) {
    1091                 $network_id = $current_site->id;
     1090                $network_id = get_current_site()->id;
    10921091        }
    10931092
    … …  
    11881187 *
    11891188 * @global wpdb   $wpdb
    1190  * @global object $current_site
    11911189 *
    11921190 * @param int    $network_id ID of the network. Can be null to default to the current network ID.
    … …  
    11961194 */
    11971195function add_network_option( $network_id, $option, $value ) {
    1198         global $wpdb, $current_site;
     1196        global $wpdb;
    11991197
    12001198        if ( $network_id && ! is_numeric( $network_id ) ) {
    … …  
    12061204        // Fallback to the current network if a network ID is not specified.
    12071205        if ( ! $network_id && is_multisite() ) {
    1208                 $network_id = $current_site->id;
     1206                $network_id = get_current_site()->id;
    12091207        }
    12101208
    … …  
    12981296 *
    12991297 * @global wpdb   $wpdb
    1300  * @global object $current_site
    13011298 *
    13021299 * @param int    $network_id ID of the network. Can be null to default to the current network ID.
    … …  
    13051302 */
    13061303function delete_network_option( $network_id, $option ) {
    1307         global $wpdb, $current_site;
     1304        global $wpdb;
    13081305
    13091306        if ( $network_id && ! is_numeric( $network_id ) ) {
    … …  
    13151312        // Fallback to the current network if a network ID is not specified.
    13161313        if ( ! $network_id && is_multisite() ) {
    1317                 $network_id = $current_site->id;
     1314                $network_id = get_current_site()->id;
    13181315        }
    13191316
    … …  
    13801377 *
    13811378 * @global wpdb   $wpdb
    1382  * @global object $current_site
    13831379 *
    13841380 * @param int      $network_id ID of the network. Can be null to default to the current network ID.
    … …  
    13881384 */
    13891385function update_network_option( $network_id, $option, $value ) {
    1390         global $wpdb, $current_site;
     1386        global $wpdb;
    13911387
    13921388        if ( $network_id && ! is_numeric( $network_id ) ) {
    … …  
    13981394        // Fallback to the current network if a network ID is not specified.
    13991395        if ( ! $network_id && is_multisite() ) {
    1400                 $network_id = $current_site->id;
     1396                $network_id = get_current_site()->id;
    14011397        }
    14021398
Note: See TracChangeset for help on using the changeset viewer.