wp_load_core_site_options [ WordPress Function ]
wp_load_core_site_options ( $site_id = null )
| Parameters: |
|
| Defined at: |
|
Soorgelijke functies: update_site_option, add_site_option, wp_load_alloptions, get_site_option, delete_site_option
Loads and caches certain often requested site options if is_multisite() and a persistent cache is not being used.
Source
<?php
function wp_load_core_site_options( $site_id = null ) {
global $wpdb, $_wp_using_ext_object_cache;
if ( !is_multisite() || $_wp_using_ext_object_cache || defined( 'WP_INSTALLING' ) )
return;
if ( empty($site_id) )
$site_id = $wpdb->siteid;
$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' );
$core_options_in = "'" . implode("', '", $core_options) . "'";
$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) );
foreach ( $options as $option ) {
$key = $option->meta_key;
$cache_key = "{$site_id}:$key";
$option->meta_value = maybe_unserialize( $option->meta_value );
wp_cache_set( $cache_key, $option->meta_value, 'site-options' );
}
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- wp_load_core_site_options (WordPress Function) - WPSeek.com
WordPress lookup for wp_load_core_site_options, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - wpmu_current_site (WordPress Function) - WPSeek.com
$current_site->cookie_domain = substr( $current_site->domain, 4 ); else $ current_site->cookie_domain = $current_site->domain; wp_load_core_site_options( ...
wpseek.com - #18955 (get_site_option caches default value when option does not ...
comment:3 wpmuguru — 7 months ago. We should also cache the non existence of site options in wp_load_core_site_options().
core.trac.wordpress.org - Ticket #19385 - WordPress Trac
wp_load_core_site_options() should be set up to cache as false any keys it misses. As this only works when an external object cache is not at play, it basically ...
core.trac.wordpress.org