WordPress.org

Make WordPress Core

Ticket #10886: 10886.2.diff

File 10886.2.diff, 563 bytes (added by sivel, 11 years ago)

Adds $query_vars to the filter so that you can use that information to determine how you should return.

  • wp-includes/functions.php

     
    14531453 */
    14541454function wp( $query_vars = '' ) {
    14551455        global $wp, $wp_query, $wp_the_query;
    1456         $wp->main( $query_vars );
    14571456
     1457        // Return false to this filter to stop WordPress run it's own queries for this page
     1458        if ( apply_filters('run_wp_main', true, $query_vars) )
     1459                $wp->main( $query_vars );
     1460
    14581461        if( !isset($wp_the_query) )
    14591462                $wp_the_query = $wp_query;
    14601463}