mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 05:04:31 +00:00
Introduce wp_using_ext_object_cache() - mimic wp_suspend_cache_invalidation() and discourage direct access to $_wp_using_ext_object_cache, cleaning up importing of globals in functions and provides function to modify that global. Loads the packaged object cache when an external cache hasn't been loaded or doesn't contain wp_cache_init().
Fixes #21401. git-svn-id: https://develop.svn.wordpress.org/trunk@25289 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1946,7 +1946,7 @@ class WP_Query {
|
||||
* @return array List of posts.
|
||||
*/
|
||||
function get_posts() {
|
||||
global $wpdb, $user_ID, $_wp_using_ext_object_cache;
|
||||
global $wpdb, $user_ID;
|
||||
|
||||
$this->parse_query();
|
||||
|
||||
@@ -1996,7 +1996,7 @@ class WP_Query {
|
||||
$q['suppress_filters'] = false;
|
||||
|
||||
if ( !isset($q['cache_results']) ) {
|
||||
if ( $_wp_using_ext_object_cache )
|
||||
if ( wp_using_ext_object_cache() )
|
||||
$q['cache_results'] = false;
|
||||
else
|
||||
$q['cache_results'] = true;
|
||||
|
||||
Reference in New Issue
Block a user