WordPress.org

Make WordPress Core

Ticket #40671: 40671.patch

File 40671.patch, 784 bytes (added by GunGeekATX, 3 years ago)
  • wp-includes/class-wp-term.php

     
    142142
    143143                        // If a taxonomy was specified, find a match.
    144144                        if ( $taxonomy ) {
     145
     146                                // Clear out the cached term since it does not have the
     147                                // matching taxonomy.
     148                                $_term = false;
     149
    145150                                foreach ( $terms as $match ) {
    146151                                        if ( $taxonomy === $match->taxonomy ) {
    147152                                                $_term = $match;
     
    182187                        $_term = sanitize_term( $_term, $_term->taxonomy, 'raw' );
    183188
    184189                        // Don't cache terms that are shared between taxonomies.
     190                        var_dump(count($terms));
    185191                        if ( 1 === count( $terms ) ) {
    186192                                wp_cache_add( $term_id, $_term, 'terms' );
    187193                        }