wp_start_object_cache [ WordPress Function ]
wp_start_object_cache ( No parameters )
| Access: |
|
| Defined at: |
|
Benzer Fonksiyonlar: update_object_term_cache, wp_set_object_terms, get_object_term_cache, wp_get_object_terms, clean_object_term_cache
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_exists( WP_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_exists( WP_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ý
- wp_start_object_cache
wp_start_object_cache(). Defined at: /wp-includes/load.php -> line 374. Referenced 2 times: /wp-settings.php -> line 83 · /wp-includes/ms-settings.php -> line ...
phpxref.ftwr.co.uk - #15361 (wp_start_object_cache() should be called within blog ...
The switch_to_blog() and restore_current_blog() functions call wp_cache_init() directly, which causes the object cache instance to be recreated. These methods ...
core.trac.wordpress.org - #12065 (Clean up cache re-init code in Multisite) – WordPress Trac
Hypothetically, we could replace that with wp_start_object_cache() and be done with it, but to save CPU cycles and an unnecessary filesystem check, we should ...
core.trac.wordpress.org - wp_start_object_cache() WordPress function reference, arguments ...
wp_start_object_cache(). 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 ...
queryposts.com