wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_start_object_cache is private and should not be used in themes or plugins directly.
wp_start_object_cache › WordPress Function
Seit3.0.0
Veraltetn/v
› wp_start_object_cache ( Keine Parameter )
Zugriff: |
|
Definiert in: |
|
Codex: |
Start 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.
Ähnliche Funktionen: wp_using_ext_object_cache, update_object_term_cache, wp_set_object_terms, get_object_term_cache, wp_get_object_terms
Quellcode
function wp_start_object_cache() { global $wp_filter; static $first_init = true; // Only perform the following checks once. if ( $first_init ) { if ( ! function_exists( 'wp_cache_init' ) ) { /* * This is the normal situation. First-run of this function. No * caching backend has been loaded. * * We try to load a custom caching backend, and then, if it * results in a wp_cache_init() function existing, we note * that an external object cache is being used. */ if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) { require_once( WP_CONTENT_DIR . '/object-cache.php' ); if ( function_exists( 'wp_cache_init' ) ) { wp_using_ext_object_cache( true ); } // Re-initialize any hooks added manually by object-cache.php if ( $wp_filter ) { $wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter ); } } } elseif ( ! wp_using_ext_object_cache() && file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) { /* * Sometimes advanced-cache.php can load object-cache.php before * this function is run. This breaks the function_exists() check * above and can result in wp_using_ext_object_cache() returning * false when actually an external cache is in use. */ wp_using_ext_object_cache( true ); } } if ( ! wp_using_ext_object_cache() ) { require_once( ABSPATH . WPINC . '/cache.php' ); } /* * 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_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( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'site-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'blog_meta' ) ); wp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) ); } $first_init = false; }