diff --git a/wp-includes/query.php b/wp-includes/query.php index b0df07b0ee..d6915de507 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1468,7 +1468,7 @@ class WP_Query { * @since 4.5.0 Removed the `$comments_popup` parameter. * Introduced the `$comment_status` and `$ping_status` parameters. * Introduced `RAND(x)` syntax for `$orderby`, which allows an integer seed value to random sorts. - * @since 4.6.0 Added 'post_name__in' support for `$orderby`. + * @since 4.6.0 Added 'post_name__in' support for `$orderby`. Introduced `$lazy_load_term_meta`. * @access public * * @param string|array $query { @@ -1567,6 +1567,10 @@ class WP_Query { * @type string $title Post title. * @type bool $update_post_meta_cache Whether to update the post meta cache. Default true. * @type bool $update_post_term_cache Whether to update the post term cache. Default true. + * @type bool $lazy_load_term_meta Whether to lazy-load term meta. Setting to false will + * disable cache priming for term meta, so that each + * get_term_meta() call will hit the database. + * Defaults to the value of `$update_post_term_cache`. * @type int $w The week number of the year. Default empty. Accepts numbers 0-53. * @type int $year The four-digit year. Default empty. Accepts any four-digit year. * } @@ -2545,6 +2549,10 @@ class WP_Query { if ( !isset($q['update_post_term_cache']) ) $q['update_post_term_cache'] = true; + if ( ! isset( $q['lazy_load_term_meta'] ) ) { + $q['lazy_load_term_meta'] = $q['update_post_term_cache']; + } + if ( !isset($q['update_post_meta_cache']) ) $q['update_post_meta_cache'] = true; @@ -3782,7 +3790,7 @@ class WP_Query { $this->posts = array(); } - if ( $q['update_post_term_cache'] ) { + if ( $q['lazy_load_term_meta'] ) { wp_queue_posts_for_term_meta_lazyload( $this->posts ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 147167953c..ba5ec9497f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37588'; +$wp_version = '4.6-alpha-37589'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.