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
This commit is contained in:
Sergey Biryukov 2013-01-28 02:55:06 +00:00
parent 3d8a1289d2
commit 3e917ac75f

View File

@ -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 );