wp_cache_add_global_groups example


    if ( ! $first_init && function_exists( 'wp_cache_switch_to_blog' ) ) {
        wp_cache_switch_to_blog( get_current_blog_id() );
    } elseif ( function_exists( 'wp_cache_init' ) ) {
        wp_cache_init();
    }

    if ( function_exists( 'wp_cache_add_global_groups' ) ) {
        wp_cache_add_global_groups(
            array(
                'blog-details',
                'blog-id-cache',
                'blog-lookup',
                'blog_meta',
                'global-posts',
                'networks',
                'network-queries',
                'sites',
                'site-details',
                'site-options',
                
if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) {
            $global_groups = $wp_object_cache->global_groups;
        } else {
            $global_groups = false;
        }

        wp_cache_init();

        if ( function_exists( 'wp_cache_add_global_groups' ) ) {
            if ( is_array( $global_groups ) ) {
                wp_cache_add_global_groups( $global_groups );
            } else {
                wp_cache_add_global_groups(
                    array(
                        'blog-details',
                        'blog-id-cache',
                        'blog-lookup',
                        'blog_meta',
                        'global-posts',
                        'networks',
                        'network-queries',
                        'sites',
                        

    public function __construct( $theme_dir$theme_root$_child = null ) {
        global $wp_theme_directories;

        // Initialize caching on first run.         if ( ! isset( self::$persistently_cache ) ) {
            /** This action is documented in wp-includes/theme.php */
            self::$persistently_cache = apply_filters( 'wp_cache_themes_persistently', false, 'WP_Theme' );
            if ( self::$persistently_cache ) {
                wp_cache_add_global_groups( 'themes' );
                if ( is_int( self::$persistently_cache ) ) {
                    self::$cache_expiration = self::$persistently_cache;
                }
            } else {
                wp_cache_add_non_persistent_groups( 'themes' );
            }
        }

        // Handle a numeric theme directory as a string.         $theme_dir = (string) $theme_dir;

        
Home | Imprint | This part of the site doesn't use cookies.