WordPress.org

Make WordPress Core

Ticket #15835: taxonomy.php.diff

File taxonomy.php.diff, 1.1 KB (added by lancewillett, 7 years ago)
  • wp-includes/taxonomy.php

     
    18301830                $select_this = 't.term_id';
    18311831        else if ( 'names' == $fields )
    18321832                $select_this = 't.name';
     1833        else if ( 'slugs' == $fields )
     1834                $select_this = 't.slug';
    18331835        else if ( 'all_with_object_id' == $fields )
    18341836                $select_this = 't.*, tt.*, tr.object_id';
    18351837
     
    18381840        if ( 'all' == $fields || 'all_with_object_id' == $fields ) {
    18391841                $terms = array_merge($terms, $wpdb->get_results($query));
    18401842                update_term_cache($terms);
    1841         } else if ( 'ids' == $fields || 'names' == $fields ) {
     1843        } else if ( 'ids' == $fields || 'names' == $fields || 'slugs' == $fields ) {
    18421844                $terms = array_merge($terms, $wpdb->get_col($query));
    18431845        } else if ( 'tt_ids' == $fields ) {
    18441846                $terms = $wpdb->get_col("SELECT tr.term_taxonomy_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tr.object_id IN ($object_ids) AND tt.taxonomy IN ($taxonomies) $orderby $order");