In WP::handle_404()
, make sure $wp_query->post
is a WP_Post
object before cloning it.
Props igmoweb for initial patch. See #35013. git-svn-id: https://develop.svn.wordpress.org/trunk@35994 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
203199de6f
commit
ab8cff7827
@ -609,7 +609,12 @@ class WP {
|
|||||||
|
|
||||||
$success = true;
|
$success = true;
|
||||||
if ( is_singular() ) {
|
if ( is_singular() ) {
|
||||||
$p = clone $wp_query->post;
|
$p = false;
|
||||||
|
|
||||||
|
if ( $wp_query->post instanceof WP_Post ) {
|
||||||
|
$p = clone $wp_query->post;
|
||||||
|
}
|
||||||
|
|
||||||
// Only set X-Pingback for single posts that allow pings.
|
// Only set X-Pingback for single posts that allow pings.
|
||||||
if ( $p && pings_open( $p ) ) {
|
if ( $p && pings_open( $p ) ) {
|
||||||
@header( 'X-Pingback: ' . get_bloginfo( 'pingback_url' ) );
|
@header( 'X-Pingback: ' . get_bloginfo( 'pingback_url' ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user