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:
parent
e4a2e0c4a9
commit
35dd8003b0
|
@ -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 );
|
||||
|
||||
if ( null === $position )
|
||||
if ( null === $position ) {
|
||||
$menu[] = $new_menu;
|
||||
else
|
||||
$menu[$position] = $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 {
|
||||
$menu[ $position ] = $new_menu;
|
||||
}
|
||||
|
||||
$_registered_pages[$hookname] = true;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @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.
|
||||
|
|
Loading…
Reference in New Issue