From 81e88f1ec3bcec5d0b2e9c92a42fdca3ce79ffb3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 28 Jan 2013 02:55:06 +0000 Subject: [PATCH] Make sure the post exists before checking its ID. fixes #23026. git-svn-id: https://develop.svn.wordpress.org/trunk@23351 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 788a4bd55f..9f6833c5d3 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -680,7 +680,7 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) { if ( $items ) { foreach ( $items as $item ) { // A page cannot be its own parent. - if ( $post->ID && $item->ID == $post->ID ) + if ( $post && $post->ID && $item->ID == $post->ID ) continue; $pad = str_repeat( ' ', $level * 3 );