WordPress.org

Make WordPress Core

Ticket #15835: 15835.patch

File 15835.patch, 1.1 KB (added by SergeyBiryukov, 3 years ago)
  • wp-includes/taxonomy.php

     
    18921892                $select_this = 't.term_id'; 
    18931893        else if ( 'names' == $fields ) 
    18941894                $select_this = 't.name'; 
     1895        else if ( 'slugs' == $fields ) 
     1896                $select_this = 't.slug'; 
    18951897        else if ( 'all_with_object_id' == $fields ) 
    18961898                $select_this = 't.*, tt.*, tr.object_id'; 
    18971899 
     
    19001902        if ( 'all' == $fields || 'all_with_object_id' == $fields ) { 
    19011903                $terms = array_merge($terms, $wpdb->get_results($query)); 
    19021904                update_term_cache($terms); 
    1903         } else if ( 'ids' == $fields || 'names' == $fields ) { 
     1905        } else if ( 'ids' == $fields || 'names' == $fields || 'slugs' == $fields ) { 
    19041906                $terms = array_merge($terms, $wpdb->get_col($query)); 
    19051907        } else if ( 'tt_ids' == $fields ) { 
    19061908                $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");