[wp-trac] [WordPress Trac] #34833: When given 'tag' as an argument into wp_query it ignores suppress_filters

WordPress Trac noreply at wordpress.org
Fri Dec 4 21:31:56 UTC 2015


#34833: When given 'tag' as an argument into wp_query it ignores suppress_filters
-------------------------------+------------------------------
 Reporter:  BenzinNZ           |       Owner:
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Query              |     Version:  4.3.1
 Severity:  normal             |  Resolution:  invalid
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by BenzinNZ):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Hmmm looks like something else is occurring outside of my scope of
 knowledge - some plugin must be editing the query. Going to be a long day
 :(

 {{{#!php
 <?php
 function pre_condition ( $where ) { return $where . ' AND 1=2 '; }
 add_filter( 'posts_where' , 'pre_condition' );

  $args = array(
         'suppress_filters' => true,
         'tag' => 'tagthatexists',
 );
 $postsToList= new wp_query( $args );
 var_dump($postsToList);
 ?>
 }}}

 Works as expected on clean install!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34833#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list