mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Restore the ability to pass classes to admin menu submenu items, important for the Customize link. Accidentally left out in [24048]. fixes #28583.
Built from https://develop.svn.wordpress.org/trunk@28778 git-svn-id: http://core.svn.wordpress.org/trunk@28591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1dd9c189e9
commit
95deee2de5
@ -135,6 +135,8 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
|
||||
echo "<li class='wp-submenu-head'>{$item[0]}</li>";
|
||||
|
||||
$first = true;
|
||||
|
||||
// 0 = menu_title, 1 = capability, 2 = menu_slug, 3 = classes
|
||||
foreach ( $submenu_items as $sub_key => $sub_item ) {
|
||||
if ( ! current_user_can( $sub_item[1] ) )
|
||||
continue;
|
||||
@ -165,6 +167,10 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
|
||||
$class[] = 'current';
|
||||
}
|
||||
|
||||
if ( ! empty( $sub_item[3] ) ) {
|
||||
$class[] = $sub_item[3];
|
||||
}
|
||||
|
||||
$class = $class ? ' class="' . join( ' ', $class ) . '"' : '';
|
||||
|
||||
$menu_hook = get_plugin_page_hook($sub_item[2], $item[2]);
|
||||
|
Loading…
Reference in New Issue
Block a user