Admin Menu: allow more than one menu item to be added at the same priority/position.

Props chriscct7.
Fixes #23316.

Built from https://develop.svn.wordpress.org/trunk@35477


git-svn-id: http://core.svn.wordpress.org/trunk@35441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-10-31 20:31:24 +00:00
parent e4a2e0c4a9
commit 35dd8003b0
2 changed files with 8 additions and 4 deletions

View File

@ -1052,10 +1052,14 @@ function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $func
$new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $icon_class . $hookname, $hookname, $icon_url ); $new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $icon_class . $hookname, $hookname, $icon_url );
if ( null === $position ) if ( null === $position ) {
$menu[] = $new_menu; $menu[] = $new_menu;
else } elseif ( isset( $menu[ "$position" ] ) ) {
$menu[$position] = $new_menu; $position = $position + substr( base_convert( md5( $menu_slug . $menu_title ), 16, 10 ) , -5 ) * 0.00001;
$menu[ "$position" ] = $new_menu;
} else {
$menu[ $position ] = $new_menu;
}
$_registered_pages[$hookname] = true; $_registered_pages[$hookname] = true;

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-beta2-35476'; $wp_version = '4.4-beta2-35477';
/** /**
* 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.