Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_start_object_cache [ WordPress Function ]

wp_start_object_cache ( No parameters )
Access:
  • private
Defined at:



Starts the WordPress object cache.

If an object-cache.php file exists in the wp-content directory, it uses that drop-in as an external object cache.

Source


<?php
function wp_start_object_cache() {
    global 
$_wp_using_ext_object_cache;

    
$first_init false;
     if ( ! 
function_exists'wp_cache_init' ) ) {
        if ( 
file_existsWP_CONTENT_DIR '/object-cache.php' ) ) {
            require_once ( 
WP_CONTENT_DIR '/object-cache.php' );
            
$_wp_using_ext_object_cache true;
        } else {
            require_once ( 
ABSPATH WPINC '/cache.php' );
            
$_wp_using_ext_object_cache false;
        }
        
$first_init true;
    } else if ( !
$_wp_using_ext_object_cache && file_existsWP_CONTENT_DIR '/object-cache.php' ) ) {
        
// Sometimes advanced-cache.php can load object-cache.php before it is loaded here.
        // This breaks the function_exists check above and can result in $_wp_using_ext_object_cache
        // being set incorrectly. Double check if an external cache exists.
        
$_wp_using_ext_object_cache true;
    }

    
// If cache supports reset, reset instead of init if already initialized.
    // Reset signals to the cache that global IDs have changed and it may need to update keys
    // and cleanup caches.
    
if ( !$first_init && function_exists('wp_cache_reset') )
        
wp_cache_reset();
    else
        
wp_cache_init();

    if ( 
function_exists'wp_cache_add_global_groups' ) ) {
        
wp_cache_add_global_groups( array( 'users''userlogins''usermeta''user_meta''site-transient''site-options''site-lookup''blog-lookup''blog-details''rss''global-posts' ) );
        
wp_cache_add_non_persistent_groups( array( 'comment''counts''plugins' ) );
    }
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics