Changeset 56061
- Timestamp:
- 06/27/2023 10:39:55 AM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/option.php
r55884 r56061 362 362 363 363 /** 364 * Loads and caches certain often requested site options if is_multisite() and a persistent cache is not being used.364 * Loads and primes caches of certain often requested network options if is_multisite(). 365 365 * 366 366 * @since 3.0.0 367 * @since 6.3.0 Also prime caches for network options when persistent object cache is enabled. 367 368 * 368 369 * @global wpdb $wpdb WordPress database abstraction object. 369 370 * 370 * @param int $network_id Optional site ID for which to query the options. Defaults to the current site.371 * @param int $network_id Optional. Network ID of network for which to prime network options cache. Defaults to current network. 371 372 */ 372 373 function wp_load_core_site_options( $network_id = null ) { 373 374 global $wpdb; 374 375 375 if ( ! is_multisite() || wp_ using_ext_object_cache() || wp_installing() ) {376 if ( ! is_multisite() || wp_installing() ) { 376 377 return; 377 378 } … … 382 383 383 384 $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' ); 385 386 if ( wp_using_ext_object_cache() ) { 387 $cache_keys = array(); 388 foreach ( $core_options as $option ) { 389 $cache_keys[] = "{$network_id}:{$option}"; 390 } 391 wp_cache_get_multiple( $cache_keys, 'site-options' ); 392 393 return; 394 } 384 395 385 396 $core_options_in = "'" . implode( "', '", $core_options ) . "'";
Note: See TracChangeset
for help on using the changeset viewer.