Add can_compress_scripts to core site options. Add phpdoc for wp_load_core_site_options(). see #11644

git-svn-id: http://svn.automattic.com/wordpress/trunk@13069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-02-12 20:23:06 +00:00
parent 224b82e5e0
commit 2d78f9d6bc
1 changed files with 10 additions and 1 deletions

View File

@ -437,6 +437,15 @@ function wp_load_alloptions() {
return $alloptions; return $alloptions;
} }
/**
* Loads and caches certain often requested site options if is_multisite() and a peristent cache is not being used.
*
* @since 3.0.0
* @package WordPress
* @subpackage Option
*
* @param int $site_id Optional site ID for which to query the options. Defaults to the current site.
*/
function wp_load_core_site_options( $site_id = null ) { function wp_load_core_site_options( $site_id = null ) {
global $wpdb, $_wp_using_ext_object_cache; global $wpdb, $_wp_using_ext_object_cache;
@ -446,7 +455,7 @@ function wp_load_core_site_options( $site_id = null ) {
if ( empty($site_id) ) if ( empty($site_id) )
$site_id = $wpdb->siteid; $site_id = $wpdb->siteid;
$core_options = array('site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'dashboard_blog'); $core_options = array('site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'dashboard_blog', 'can_compress_scripts');
$core_options_in = "'" . implode("', '", $core_options) . "'"; $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) ); $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) );