Avoid a fatal error in wp_reset_postdata() if $wp_query global is not set.
see #26775 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@26932 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0e6a9edaec
commit
0938ef0815
@ -115,7 +115,10 @@ function wp_reset_query() {
|
||||
*/
|
||||
function wp_reset_postdata() {
|
||||
global $wp_query;
|
||||
$wp_query->reset_postdata();
|
||||
|
||||
if ( isset( $wp_query ) ) {
|
||||
$wp_query->reset_postdata();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user