Make WordPress Core

Ticket #10886: 10886.4.diff

File 10886.4.diff, 803 bytes (added by tyxla, 10 years ago)

Fixing run_wp_main filter documentation

  • src/wp-includes/functions.php

     
    873873 */
    874874function wp( $query_vars = '' ) {
    875875        global $wp, $wp_query, $wp_the_query;
    876         $wp->main( $query_vars );
     876       
     877        /**
     878         * Filter whether to setup the WordPress environment variables.
     879         *
     880         * @since 4.2
     881         *
     882         * @param bool True will setup the WordPress environment variables, false will not.
     883         * @param string|array $query_vars Default WP_Query arguments.
     884         */
     885        if ( apply_filters( 'run_wp_main', true, $query_vars ) ) {
     886                $wp->main( $query_vars );
     887        }
    877888
    878         if ( !isset($wp_the_query) )
     889        if ( !isset($wp_the_query) ) {
    879890                $wp_the_query = $wp_query;
     891        }
    880892}
    881893
    882894/**