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

see #26775 for trunk.
Built from https://develop.svn.wordpress.org/trunk@26932


git-svn-id: http://core.svn.wordpress.org/trunk@26813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-01-11 23:57:14 +00:00
parent 3ee2262d7e
commit 9572d2d001

View File

@ -115,7 +115,10 @@ function wp_reset_query() {
*/ */
function wp_reset_postdata() { function wp_reset_postdata() {
global $wp_query; global $wp_query;
if ( isset( $wp_query ) ) {
$wp_query->reset_postdata(); $wp_query->reset_postdata();
}
} }
/* /*