Make WordPress Core


Ignore:
Timestamp:
10/31/2015 08:30:06 PM (9 years ago)
Author:
wonderboymusic
Message:

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

Props chriscct7.
Fixes #23316.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r35373 r35477  
    10531053    $new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $icon_class . $hookname, $hookname, $icon_url );
    10541054
    1055     if ( null === $position )
     1055    if ( null === $position ) {
    10561056        $menu[] = $new_menu;
    1057     else
    1058         $menu[$position] = $new_menu;
     1057    } elseif ( isset( $menu[ "$position" ] ) ) {
     1058        $position = $position + substr( base_convert( md5( $menu_slug . $menu_title ), 16, 10 ) , -5 ) * 0.00001;
     1059        $menu[ "$position" ] = $new_menu;
     1060    } else {
     1061        $menu[ $position ] = $new_menu;
     1062    }
    10591063
    10601064    $_registered_pages[$hookname] = true;
Note: See TracChangeset for help on using the changeset viewer.