diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 32a37f106a..92743086f4 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -1388,8 +1388,9 @@ function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $submenu[ $parent_slug ][] = $new_sub_menu; } else { - // If position is equal or higher than the number of items in the array, append the submenu. - if ( $position >= count( $submenu[ $parent_slug ] ) ) { + // Append the submenu if the parent item is not present in the submenu, + // or if position is equal or higher than the number of items in the array. + if ( ! isset( $submenu[ $parent_slug ] ) || $position >= count( $submenu[ $parent_slug ] ) ) { $submenu[ $parent_slug ][] = $new_sub_menu; } else { // Test for a negative position. diff --git a/wp-includes/version.php b/wp-includes/version.php index 0459d663c2..84b3629bae 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3.1-alpha-46867'; +$wp_version = '5.3.1-alpha-46869'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.