WordPress.org

Make WordPress Core

Ticket #41010: 41010.patch

File 41010.patch, 701 bytes (added by bor0, 2 years ago)
  • wp-includes/taxonomy.php

     
    18641864        $args['taxonomy'] = $taxonomies;
    18651865        $args['object_ids'] = $object_ids;
    18661866
    1867         $terms = array_merge( $terms, get_terms( $args ) );
     1867        // In case not all taxonomies were unset by the processing above, get the terms of the remaining.
     1868        // Otherwise, if we call `get_terms` with `'taxonomy' => array()` it will return all taxonomies.
     1869        if ( ! empty( $args['taxonomy'] ) ) {
     1870                $terms = array_merge( $terms, get_terms( $args ) );
     1871        }
    18681872
    18691873        /**
    18701874         * Filters the terms for a given object or objects.