From 3e917ac75f0bc10658dcb5acce964b32e6c5ab94 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: http://core.svn.wordpress.org/trunk@23351 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 );