[wp-trac] [WordPress Trac] #17019: context arg for WP_Query filter application (was: add hooks for Media Library attachment counts)

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 7 05:01:58 UTC 2011


#17019: context arg for WP_Query filter application
-------------------------+------------------------------
 Reporter:  kevinB       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Query        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------
Changes (by kevinB):

 * cc: kevin@… (added)
 * component:  Media => Query


Comment:

 The updated patch also adds WP_Query support for fields=count.

 wp_count_attachments() filtering is removed to a different patch.

 I decided to apply a context check right in apply_filters_ref_array()
 rather than just passing it to the filter function.  That way if plugins
 specify a context arg in add_filter(), the increased use of get_posts()
 throughout wp-admin won't multiply call_user_func_array() executions.

 If there is a high level of concern for retaining exact query syntax for
 the attachment orphan and gallery counts, my add_filter() calls in the
 inline code comments would be a starting point.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17019#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list