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
This commit is contained in:
Sergey Biryukov 2013-01-28 02:55:06 +00:00
parent b96d467630
commit 81e88f1ec3
1 changed files with 1 additions and 1 deletions

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