mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Taxonomy: Increase cache hits in WP_Term_Query when using include and exclude parameters.
Ensure that empty values of include and exclude passed to the parameters of `WP_Term_Query`, reused existing caches by resetting values to an empty array. Props Spacedmonkey, peterwilsoncc, hellofromtonya. Follow-up to [52970]. See #55352. git-svn-id: https://develop.svn.wordpress.org/trunk@53309 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -457,6 +457,14 @@ class WP_Term_Query {
|
||||
"tt.taxonomy IN ('" . implode( "', '", array_map( 'esc_sql', $taxonomies ) ) . "')";
|
||||
}
|
||||
|
||||
if ( empty( $args['exclude'] ) ) {
|
||||
$args['exclude'] = array();
|
||||
}
|
||||
|
||||
if ( empty( $args['include'] ) ) {
|
||||
$args['include'] = array();
|
||||
}
|
||||
|
||||
$exclude = $args['exclude'];
|
||||
$exclude_tree = $args['exclude_tree'];
|
||||
$include = $args['include'];
|
||||
|
||||
Reference in New Issue
Block a user