From 35dd8003b0e8f4330a653a686cda6041ee06964b Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 31 Oct 2015 20:31:24 +0000 Subject: [PATCH] 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 --- wp-admin/includes/plugin.php | 10 +++++++--- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 926e5e62c7..f0d207a567 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -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; diff --git a/wp-includes/version.php b/wp-includes/version.php index b0fe52a322..ffee71d47c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.