[wp-trac] [WordPress Trac] #49028: Provide functionality to suppress $wpdb query filter

WordPress Trac noreply at wordpress.org
Sat Feb 8 13:50:27 UTC 2020


#49028: Provide functionality to suppress $wpdb query filter
-------------------------------+------------------------------
 Reporter:  aurovrata          |       Owner:  (none)
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Database           |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by aurovrata):

 Here is what I propose in the `$wpdb` class (`wp-incudes/wp-db.php`),

 {{{#!php
 <?php
 //declare a new variable property for the class
 /**
  * Whether to suppress filters 'query' filter prior to execution..
  *
  * @since 5.4.0
  * @var bool
  */
 var $suppress_filters = false;

 //on line 1902 in the query() method

 if(!$this->suppress_filters)    $query = apply_filters( 'query', $query );
 }}}


 so by default no change whatsoever to the current working of the class.

 i have attached my modified wp-db.php file to this ticket.

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


More information about the wp-trac mailing list