Make WordPress Core

Changeset 22417


Ignore:
Timestamp:
11/07/2012 09:03:40 AM (12 years ago)
Author:
nacin
Message:

Treat a single taxonomy passed as an array the same as when passed as a string in get_terms(). props wonderboymusic, fixes #17955.

File:
1 edited

Legend:

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

    r22309 r22417  
    11891189    $empty_array = array();
    11901190
    1191     $single_taxonomy = false;
    1192     if ( !is_array($taxonomies) ) {
    1193         $single_taxonomy = true;
    1194         $taxonomies = array($taxonomies);
    1195     }
     1191    $single_taxonomy = ! is_array( $taxonomies ) || 1 === count( $taxonomies );
     1192    if ( ! is_array( $taxonomies ) )
     1193        $taxonomies = array( $taxonomies );
    11961194
    11971195    foreach ( $taxonomies as $taxonomy ) {
Note: See TracChangeset for help on using the changeset viewer.