mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Split the main WP_Query posts query into two queries to avoid temp tables. Leverage cache to avoid second query in persistent cache environments. Props scribu, cheald, prettyboymp. see #18536
git-svn-id: https://develop.svn.wordpress.org/trunk@19918 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3703,3 +3703,26 @@ function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pr
|
||||
else
|
||||
return $caller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ids that are not already present in the cache
|
||||
*
|
||||
* @since 3.4.0
|
||||
*
|
||||
* @param array $object_ids ID list
|
||||
* @param string $cache_key The cache bucket to check against
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function _get_non_cached_ids( $object_ids, $cache_key ) {
|
||||
$clean = array();
|
||||
foreach ( $object_ids as $id ) {
|
||||
$id = (int) $id;
|
||||
if ( !wp_cache_get( $id, $cache_key ) ) {
|
||||
$clean[] = $id;
|
||||
}
|
||||
}
|
||||
|
||||
return $clean;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user