Make WordPress Core


Ignore:
Timestamp:
09/29/2015 09:59:44 PM (9 years ago)
Author:
boonebgorges
Message:

Improve lazyloading of term metadata in WP_Query loops.

[34529] introduced lazyloading for the metadata belonging to terms matching
posts in the main WP_Query. The current changeset improves this technique
in the following ways:

  • Term meta lazyloading is now performed on the results of all WP_Query queries, not just the main query.
  • Fewer global variable touches and greater encapsulation.
  • The logic for looping through posts to identify terms is now only performed once per WP_Query.

Props dlh, boonebgorges.
See #34047.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r34685 r34704  
    202202add_filter( 'title_save_pre',           'trim'                                );
    203203add_filter( 'get_comment_metadata',     'wp_lazyload_comment_meta',     10, 2 );
    204 add_filter( 'get_term_metadata',        'wp_lazyload_term_meta',        10, 2 );
    205204
    206205add_filter( 'http_request_host_is_external', 'allowed_http_request_hosts', 10, 2 );
Note: See TracChangeset for help on using the changeset viewer.