WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#15020 closed enhancement (fixed)

Additional Filters to get_terms

Reported by: sc0ttkclark Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Plugins Keywords: has-patch
Focuses: Cc:

Description

Currently in 3.1 (trunk) there is a general lack filters running on get_terms to enable advanced filtering and other functionality.

See my attached patch that offers up similar functionality to WP_Query::query

Attachments (2)

wp-includes-taxonomy-filters.patch (1.5 KB) - added by sc0ttkclark 11 years ago.
Initial Patch including the new filters
wp-includes-taxonomy-filters-refresh.patch (1.8 KB) - added by sc0ttkclark 11 years ago.
Refreshed patch, also adjusted final returns (cached / non-cached) to use best-practice coding as per @scribu's suggestion

Download all attachments as: .zip

Change History (11)

@sc0ttkclark
11 years ago

Initial Patch including the new filters

#1 @sc0ttkclark
11 years ago

Just wanted to check in and see if there was anything further needed from me to get this into 3.1?

@sc0ttkclark
11 years ago

Refreshed patch, also adjusted final returns (cached / non-cached) to use best-practice coding as per @scribu's suggestion

#3 @sc0ttkclark
11 years ago

  • Keywords has-patch added

Refreshed patch, also adjusted final returns (cached / non-cached) to use best-practice coding as per @scribu's suggestion

#4 @scribu
11 years ago

(In [16056]) Add terms_clauses filter. Props sc0ttkclark for initial patch. See #15020

#5 @scribu
11 years ago

I haven't included the 'pre_get_terms' filter because I'm thinking you might want to also modify the taxonomies array.

A solution would be to put $taxonomies inside $args, pass it to the filter and then overwrite the $taxonomy variable.

#6 @sc0ttkclark
11 years ago

Taxonomies inside args sounds good.

#7 @scribu
11 years ago

  • Milestone changed from Awaiting Review to 3.1

Or call it 'get_terms_args' instead.

#8 @sc0ttkclark
11 years ago

I'm good either way, though I'd prefer some ability to intercept $args

#9 @scribu
11 years ago

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

(In [16059]) Introduce get_terms_args filter. Fixes #15020

Note: See TracTickets for help on using tickets.