Make WordPress Core

Opened 16 years ago

Closed 13 years ago

#14448 closed enhancement (duplicate)

get_terms(): Add "slugs" option for $fields

Reported by: wjm Owned by:
Priority: normal Milestone:
Component: Taxonomy Version: 3.0
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

This patch allows get_terms to return an array of term slugs (same as for "names" but with slugs).

Usage:

print_r( get_terms( 'event', array( 'fields'=>'slugs', 'hide_empty'=>0, ) ) );

will return

Array
(
    [0] => concerts
    [1] => talks
    [2] => training
    [3] => workshops
)

Attachments (2)

get_terms.patch​ (735 bytes ) - added by wjm 16 years ago.
14448.patch​ (773 bytes ) - added by SergeyBiryukov 15 years ago.

Download all attachments as: .zip

Change History (7)

@wjm
16 years ago

#1 @nacin
16 years ago

  • Milestone Awaiting Review → Future Release

#2 @Hekos
15 years ago

  • Cc Hekos added
  • Version 3.0 → 3.3

This enhancement is related to #15835 [18603] and should be added for consistency.

#3 @SergeyBiryukov
15 years ago

  • Version 3.3 → 3.0

Refreshed the patch.

Version field indicates when the enhancement was initially suggested.

#4 @wonderboymusic
13 years ago

  • Milestone Future Release → 3.7

Patch still applies

#5 @wonderboymusic
13 years ago

  • Milestone 3.7
  • Resolution → duplicate
  • Status new → closed

Actually, scratch that. #13661 has the more useful ids=>slugs

Note: See TracTickets for help on using tickets.