From ae2cce3f6447d62e73aed0596544f19b5fbbb0c9 Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 19 Jun 2014 02:17:08 +0000 Subject: [PATCH] Restore the ability to pass classes to admin menu submenu items, important for the Customize link. Accidentally left out in [24048]. fixes #28583. git-svn-id: https://develop.svn.wordpress.org/trunk@28778 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/menu-header.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wp-admin/menu-header.php b/src/wp-admin/menu-header.php index 1771fb0f8a..fdfc3f5eb0 100644 --- a/src/wp-admin/menu-header.php +++ b/src/wp-admin/menu-header.php @@ -135,6 +135,8 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { echo "
  • {$item[0]}
  • "; $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]);