WordPress.org

Make WordPress Core

Changeset 40147


Ignore:
Timestamp:
03/03/2017 03:01:39 AM (4 years ago)
Author:
boonebgorges
Message:

Taxonomy: When querying terms, ensure $taxonomies is an array.

This avoids PHP notices that otherwise arise when no taxonomy
parameter is passed to get_terms() or WP_Term_Query.

Props dlh.
Fixes #39932.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-term-query.php

    r40053 r40147  
    324324        do_action( 'pre_get_terms', $this );
    325325
    326         $taxonomies = $args['taxonomy'];
     326        $taxonomies = (array) $args['taxonomy'];
    327327
    328328        // Save queries by not crawling the tree in the case of multiple taxes or a flat tax.
Note: See TracChangeset for help on using the changeset viewer.