Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#15410 closed defect (bug) (fixed)

filter for get_the_terms

Reported by: filosofo's profile filosofo Owned by: filosofo's profile filosofo
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description

get_the_terms() really needs a filter, because it pulls data when available directly from the cache.

That means that to reliably filter the terms based on the context in which they're being used, you have to filter it downstream in the functions that are calling it, which doesn't always work well.

For example, get_the_term_list() calls get_the_terms(), but the filter for get_the_term_list() comes too late to prevent a return value; filtering out the terms there will still return the before and after strings.

Attachments (1)

filter_get_the_terms.15410.diff (433 bytes) - added by filosofo 13 years ago.

Download all attachments as: .zip

Change History (2)

#1 @scribu
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [16342]) Add 'get_the_terms' filter. Props filosofo. Fixes #15410

Note: See TracTickets for help on using tickets.