[wp-trac] [WordPress Trac] #12723: apply_filters_ref_array bug

WordPress Trac wp-trac at lists.automattic.com
Fri Mar 26 22:42:34 UTC 2010


#12723: apply_filters_ref_array bug
-----------------------------+----------------------------------------------
 Reporter:  jfarthing84      |       Owner:  westi       
     Type:  defect (bug)     |      Status:  new         
 Priority:  highest omg bbq  |   Milestone:  Unassigned  
Component:  Plugins          |     Version:  3.0         
 Severity:  blocker          |    Keywords:  dev-feedback
-----------------------------+----------------------------------------------
 I believe (unless I am not using it correctly) that there is a bug with
 the new apply_filters_ref_array() function. Particularly, I am applying
 two different functions certain 'posts_' filters in the query, and only
 the one with the highest priority is processed. Small example:


 {{{
 function posts_where_filter_one($where) {
   global $wpdb;
   $where .= " AND $wpdb->posts.post_type = 'post'";
 }
 add_filter('posts_where', 'posts_where_filter_one');

 function posts_where_filter_two($where) {
   global $wpdb;
   $where .= " AND $wpdb->posts.post_status = 'publish'";
 }
 add_filter('posts_where', 'posts_where_filter_two');
 }}}


 You would expect $where to end up as:

 AND wp_posts.post_type = 'post' AND wp_posts.post_status = 'publish'

 But instead it end up as:

 AND wp_posts.post_status = 'publish'

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12723>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list