WordPress.org

Make WordPress Core

Ticket #2721: query_filter_20.diff

File query_filter_20.diff, 591 bytes (added by markjaquith, 11 years ago)

Patch for 2.0.x

  • wp-includes/wp-db.php

     
    131131        //      Basic Query     - see docs for more detail
    132132
    133133        function query($query) {
     134                // filter the query, if filters are available
     135                // NOTE: some queries are made before the plugins have been loaded, and thus cannot be filtered with this method
     136                if ( function_exists('apply_filters') )
     137                        $query = apply_filters('query',$query);
     138
    134139                // initialise return
    135140                $return_val = 0;
    136141                $this->flush();