Make WordPress Core


Ignore:
Timestamp:
03/23/2022 10:37:11 AM (4 years ago)
Author:
spacedmonkey
Message:

Query: Improved sticky post query

Ensure that the parameters update_post_meta_cache, update_post_term_cache, cache_results, suppress_filters and
lazy_load_term_meta that are passed to WP_Query, are also passed down to the secondary query used to get sticky
posts.

Props Spacedmonkey, peterwilsoncc, rehanali, uday17035.
Fixes #36907.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-query.php

    r52977 r52982  
    32613261                $stickies = get_posts(
    32623262                    array(
    3263                         'post__in'    => $sticky_posts,
    3264                         'post_type'   => $post_type,
    3265                         'post_status' => 'publish',
    3266                         'nopaging'    => true,
     3263                        'cache_results'          => $q['cache_results'],
     3264                        'lazy_load_term_meta'    => $q['lazy_load_term_meta'],
     3265                        'post__in'               => $sticky_posts,
     3266                        'post_type'              => $post_type,
     3267                        'post_status'            => 'publish',
     3268                        'suppress_filters'       => $q['suppress_filters'],
     3269                        'update_post_meta_cache' => $q['update_post_meta_cache'],
     3270                        'update_post_term_cache' => $q['update_post_term_cache'],
    32673271                    )
    32683272                );
Note: See TracChangeset for help on using the changeset viewer.