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.

git-svn-id: https://develop.svn.wordpress.org/trunk@49138 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling 2020-10-13 19:57:10 +00:00
parent 5fa77839fe
commit 798a3ba35e

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