WordPress.org

Make WordPress Core

Changeset 26932 for trunk


Ignore:
Timestamp:
01/11/2014 11:56:43 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Avoid a fatal error in wp_reset_postdata() if $wp_query global is not set.

see #26775 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/query.php

    r26874 r26932  
    116116function wp_reset_postdata() {
    117117    global $wp_query;
    118     $wp_query->reset_postdata();
     118
     119    if ( isset( $wp_query ) ) {
     120        $wp_query->reset_postdata();
     121    }
    119122}
    120123
Note: See TracChangeset for help on using the changeset viewer.