Make WordPress Core

Ticket #23636: taxonomy.patch

File taxonomy.patch, 654 bytes (added by jfarthing84, 12 years ago)

Allow array of slugs in get_terms.

  • wp-includes/taxonomy.php

     
    13301330        $exclusions = apply_filters('list_terms_exclusions', $exclusions, $args );
    13311331        $where .= $exclusions;
    13321332
    1333         if ( !empty($slug) ) {
    1334                 $slug = sanitize_title($slug);
    1335                 $where .= " AND t.slug = '$slug'";
     1333        if ( ! empty( $slug ) ) {
     1334                if ( ! is_array( $slug ) )
     1335                        $slug = array( $slug );
     1336                $slug = array_map( 'sanitize_title', $slug );
     1337                $where .= " AND t.slug IN ('" . implode( "', '", $slug ) . "')";
    13361338        }
    13371339
    13381340        if ( !empty($name__like) ) {