Make WordPress Core

Opened 4 years ago

Last modified 7 months ago

#13949 new enhancement

Add a sprintf style argument to wp_list_categories() for title tag.

Reported by: mfields Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch needs-testing
Focuses: Cc:


By default, wp_list_categories() will use the value of $term->description for the title tag of every link that it generates. If the argument "use_desc_for_title" is set to false, it will produce a string like: "View all posts filed under $term->name". With the inclusion of custom post_types into core, it would be wonderful to have more control over this title. The best solution that I can think of is to add a sprintf style argument which will allow themes and plugins to provide a custom format. Something like:

'title_format' => 'View all tacos posted under %s.'

Attachments (1)

13949.diff (1.6 KB) - added by wonderboymusic 8 months ago.

Download all attachments as: .zip

Change History (4)

comment:1 nacin3 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Seems fine to me.

wonderboymusic8 months ago

comment:2 wonderboymusic8 months ago

  • Keywords has-patch needs-testing added; needs-patch removed

Added a patch - not sure how important this one is. I'll let someone else decide if they need this in 3.7

comment:3 nacin7 months ago

13949.diff screws up the translation functions. Otherwise, good for commit.

Note: See TracTickets for help on using tickets.