WordPress.org

Make WordPress Core

Ticket #16692: wp_parse_request_hook.diff

File wp_parse_request_hook.diff, 1.1 KB (added by mikeschinkel, 3 years ago)

Added 'wp_parse_request' hook

  • wp-includes/class-wp.php

     
    496496         */ 
    497497        function main($query_args = '') { 
    498498                $this->init(); 
    499                 $this->parse_request($query_args); 
     499                do_action_ref_array('wp_parse_request', array(&$this,$query_args)); 
    500500                $this->send_headers(); 
    501501                $this->query_posts(); 
    502502                $this->handle_404(); 
  • wp-settings.php

     
    6969require( ABSPATH . WPINC . '/class-wp-error.php' ); 
    7070require( ABSPATH . WPINC . '/plugin.php' ); 
    7171 
     72// Add this as soon as add_action() is available to allow plugins 
     73// to add composible alternatives to front-end $wp->parse_request(). 
     74add_action( 'wp_parse_request', 'wp_parse_request', 10, 2 ); 
     75function wp_parse_request( $query, $query_args ) { 
     76        $query->parse_request( $query_args ); 
     77} 
     78 
    7279// Include the wpdb class and, if present, a db.php database drop-in. 
    7380require_wp_db(); 
    7481