mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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:
parent
3d8a1289d2
commit
3e917ac75f
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user