Make WordPress Core


Ignore:
Timestamp:
06/16/2020 07:07:04 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Rename the $clean or $ids variable in several functions to $non_cached_ids for clarity.

  • _get_non_cached_ids()
  • update_meta_cache()
  • update_object_term_cache()

See #49542.

File:
1 edited

Legend:

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

    r48055 r48065  
    32693269                $terms  = $wpdb->get_results( "SELECT term_id, taxonomy FROM $wpdb->term_taxonomy WHERE term_taxonomy_id IN ($tt_ids)" );
    32703270                $ids    = array();
     3271
    32713272                foreach ( (array) $terms as $term ) {
    32723273                        $taxonomies[] = $term->taxonomy;
    … …  
    32743275                        wp_cache_delete( $term->term_id, 'terms' );
    32753276                }
     3277
    32763278                $taxonomies = array_unique( $taxonomies );
    32773279        } else {
    32783280                $taxonomies = array( $taxonomy );
     3281
    32793282                foreach ( $taxonomies as $taxonomy ) {
    32803283                        foreach ( $ids as $id ) {
    … …  
    34063409        }
    34073410
    3408         $object_ids = array_map( 'intval', $object_ids );
     3411        $object_ids     = array_map( 'intval', $object_ids );
     3412        $non_cached_ids = array();
    34093413
    34103414        $taxonomies = get_object_taxonomies( $object_type );
    34113415
    3412         $ids = array();
    34133416        foreach ( $taxonomies as $taxonomy ) {
    34143417                $cache_values = wp_cache_get_multiple( (array) $object_ids, "{$taxonomy}_relationships" );
    3415                 foreach ( $cache_values as $key => $value ) {
     3418
     3419                foreach ( $cache_values as $id => $value ) {
    34163420                        if ( false === $value ) {
    3417                                 $ids[] = $key;
     3421                                $non_cached_ids[] = $id;
    34183422                                break;
    34193423                        }
    … …  
    34213425        }
    34223426
    3423         if ( empty( $ids ) ) {
     3427        if ( empty( $non_cached_ids ) ) {
    34243428                return false;
    34253429        }
    34263430
    34273431        $terms = wp_get_object_terms(
    3428                 $ids,
     3432                $non_cached_ids,
    34293433                $taxonomies,
    34303434                array(
    … …  
    34403444        }
    34413445
    3442         foreach ( $ids as $id ) {
     3446        foreach ( $non_cached_ids as $id ) {
    34433447                foreach ( $taxonomies as $taxonomy ) {
    34443448                        if ( ! isset( $object_terms[ $id ][ $taxonomy ] ) ) {
Note: See TracChangeset for help on using the changeset viewer.