WordPress.org

Make WordPress Core

Ticket #2721: query_filter_TRUNK.diff

File query_filter_TRUNK.diff, 591 bytes (added by markjaquith, 7 years ago)

Patch for trunk

  • wp-includes/wp-db.php

     
    139139        //      Basic Query     - see docs for more detail 
    140140 
    141141        function query($query) { 
     142                // filter the query, if filters are available 
     143                // NOTE: some queries are made before the plugins have been loaded, and thus cannot be filtered with this method 
     144                if ( function_exists('apply_filters') ) 
     145                        $query = apply_filters('query',$query); 
     146 
    142147                // initialise return 
    143148                $return_val = 0; 
    144149                $this->flush();