Make WordPress Core


Ignore:
Timestamp:
05/25/2016 06:44:00 PM (9 years ago)
Author:
boonebgorges
Message:

Fix termmeta pre-fetching in wp_get_object_terms().

[34529] introduced logic intended to prime the termmeta cache for certain
values of the fields parameter. There were a few bugs:

  • The all_with_object_id param was misspelled.
  • term_id was used instead of ids.
  • The values being passed to update_termmeta_cache() in the case where fields=ids was not correct.

All of these would result in a failure to pre-fetch termmeta in some cases.

Props dlh.
Fixes #36932.

File:
1 edited

Legend:

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

    r37544 r37567  
    26292629
    26302630    // Update termmeta cache, if necessary.
    2631     if ( $args['update_term_meta_cache'] && ( 'all' === $fields || 'all_with_object_ids' === $fields || 'term_id' === $fields ) ) {
    2632         if ( 'term_id' === $fields ) {
    2633             $term_ids = $fields;
     2631    if ( $args['update_term_meta_cache'] && ( 'all' === $fields || 'all_with_object_id' === $fields || 'ids' === $fields ) ) {
     2632        if ( 'ids' === $fields ) {
     2633            $term_ids = $terms;
    26342634        } else {
    26352635            $term_ids = wp_list_pluck( $terms, 'term_id' );
Note: See TracChangeset for help on using the changeset viewer.