Make WordPress Core


Ignore:
Timestamp:
08/12/2017 12:47:38 PM (9 years ago)
Author:
flixos90
Message:

Multisite: Rename internal $site_id variables referencing networks to $network_id.

This change improves code clarity by using the current naming conventions for networks.

Props lemacarl.
Fixes #41510.

File:
1 edited

Legend:

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

    r41013 r41241  
    215215 * @global wpdb $wpdb WordPress database abstraction object.
    216216 *
    217  * @param int $site_id Optional site ID for which to query the options. Defaults to the current site.
    218  */
    219 function wp_load_core_site_options( $site_id = null ) {
     217 * @param int $network_id Optional site ID for which to query the options. Defaults to the current site.
     218 */
     219function wp_load_core_site_options( $network_id = null ) {
    220220        global $wpdb;
    221221
    … …  
    223223                return;
    224224
    225         if ( empty($site_id) )
    226                 $site_id = $wpdb->siteid;
     225        if ( empty($network_id) )
     226                $network_id = $wpdb->siteid;
    227227
    228228        $core_options = array('site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'can_compress_scripts', 'global_terms_enabled', 'ms_files_rewriting' );
    229229
    230230        $core_options_in = "'" . implode("', '", $core_options) . "'";
    231         $options = $wpdb->get_results( $wpdb->prepare("SELECT meta_key, meta_value FROM $wpdb->sitemeta WHERE meta_key IN ($core_options_in) AND site_id = %d", $site_id) );
     231        $options = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value FROM $wpdb->sitemeta WHERE meta_key IN ($core_options_in) AND site_id = %d", $network_id ) );
    232232
    233233        foreach ( $options as $option ) {
    234234                $key = $option->meta_key;
    235                 $cache_key = "{$site_id}:$key";
     235                $cache_key = "{$network_id}:$key";
    236236                $option->meta_value = maybe_unserialize( $option->meta_value );
    237237
Note: See TracChangeset for help on using the changeset viewer.