Make WordPress Core

Changeset 18603


Ignore:
Timestamp:
08/25/2011 06:49:46 PM (13 years ago)
Author:
ryan
Message:

Support fields = slugs in wp_get_object_terms(). Props lancewillett, SergeyBiryukov. fixes #15835

File:
1 edited

Legend:

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

    r18591 r18603  
    18941894    else if ( 'names' == $fields )
    18951895        $select_this = 't.name';
     1896    else if ( 'slugs' == $fields )
     1897        $select_this = 't.slug';
    18961898    else if ( 'all_with_object_id' == $fields )
    18971899        $select_this = 't.*, tt.*, tr.object_id';
     
    19021904        $terms = array_merge($terms, $wpdb->get_results($query));
    19031905        update_term_cache($terms);
    1904     } else if ( 'ids' == $fields || 'names' == $fields ) {
     1906    } else if ( 'ids' == $fields || 'names' == $fields || 'slugs' == $fields ) {
    19051907        $terms = array_merge($terms, $wpdb->get_col($query));
    19061908    } else if ( 'tt_ids' == $fields ) {
Note: See TracChangeset for help on using the changeset viewer.