From 03b49d8f88396825b39acac570f3f827ff57dcda Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 1 Nov 2014 20:28:40 +0000 Subject: [PATCH] Check `$_current_page` before using it in `Walker_Page->start_el()`. Props jeremyfelt. Fixes #26901. git-svn-id: https://develop.svn.wordpress.org/trunk@30157 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index 2f84b72774..27fe5611ca 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -1305,7 +1305,7 @@ class Walker_Page extends Walker { if ( ! empty( $current_page ) ) { $_current_page = get_post( $current_page ); - if ( in_array( $page->ID, $_current_page->ancestors ) ) { + if ( $_current_page && in_array( $page->ID, $_current_page->ancestors ) ) { $css_class[] = 'current_page_ancestor'; } if ( $page->ID == $current_page ) {