Ticket #19412: 19412.patch

File 19412.patch, 538 bytes (added by SergeyBiryukov, 18 months ago)
  • wp-includes/query.php

     
    104104 * @uses $wp_query 
    105105 */ 
    106106function wp_reset_query() { 
     107        if ( ! isset( $GLOBALS['wp_the_query'] ) ) { 
     108                _doing_it_wrong( __FUNCTION__, __( 'wp_reset_query() does not work before the query is run.' ), '3.3' ); 
     109                return; 
     110        } 
     111 
    107112        unset($GLOBALS['wp_query']); 
    108113        $GLOBALS['wp_query'] = $GLOBALS['wp_the_query']; 
    109114        wp_reset_postdata();