Changeset 41241 for trunk/src/wp-includes/option.php
- Timestamp:
- 08/12/2017 12:47:38 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/option.php
r41013 r41241 215 215 * @global wpdb $wpdb WordPress database abstraction object. 216 216 * 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 */ 219 function wp_load_core_site_options( $network_id = null ) { 220 220 global $wpdb; 221 221 … … 223 223 return; 224 224 225 if ( empty($ site_id) )226 $ site_id = $wpdb->siteid;225 if ( empty($network_id) ) 226 $network_id = $wpdb->siteid; 227 227 228 228 $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' ); 229 229 230 230 $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 ) ); 232 232 233 233 foreach ( $options as $option ) { 234 234 $key = $option->meta_key; 235 $cache_key = "{$ site_id}:$key";235 $cache_key = "{$network_id}:$key"; 236 236 $option->meta_value = maybe_unserialize( $option->meta_value ); 237 237
Note: See TracChangeset
for help on using the changeset viewer.