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