Administration: Restore alternative admin menu position for menu items with the same position value as an existing menu item.

Reverts parts of [49108].

Props johnjamesjacoby.
Fixes #42918.
Built from https://develop.svn.wordpress.org/trunk@49138


git-svn-id: http://core.svn.wordpress.org/trunk@48900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2020-10-13 19:59:08 +00:00
parent 6fe59c4bdc
commit 7137daec42
2 changed files with 4 additions and 5 deletions

View File

@ -1347,11 +1347,10 @@ function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $func
if ( null === $position ) { if ( null === $position ) {
$menu[] = $new_menu; $menu[] = $new_menu;
} elseif ( isset( $menu[ "$position" ] ) ) {
$position = $position + substr( base_convert( md5( $menu_slug . $menu_title ), 16, 10 ), -5 ) * 0.00001;
$menu[ "$position" ] = $new_menu;
} else { } else {
if ( isset( $menu[ $position ] ) ) {
$position = $position + substr( base_convert( md5( $menu_slug . $menu_title ), 16, 10 ), -5 ) * 0.00001;
}
$menu[ $position ] = $new_menu; $menu[ $position ] = $new_menu;
} }

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.6-alpha-49137'; $wp_version = '5.6-alpha-49138';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.