mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
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:
parent
3ee2262d7e
commit
9572d2d001
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user