Make WordPress Core

Changeset 29083


Ignore:
Timestamp:
07/11/2014 01:09:32 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Avoid inadvertently adding admin page titles as classes for admin menu submenu items.

fixes #28817.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/menu-header.php

    r28778 r29083  
    7474
    7575        if ( ! empty( $item[4] ) )
    76             $class[] = $item[4];
     76            $class[] = esc_attr( $item[4] );
    7777
    7878        $class = $class ? ' class="' . join( ' ', $class ) . '"' : '';
     
    137137            $first = true;
    138138
    139             // 0 = menu_title, 1 = capability, 2 = menu_slug, 3 = classes
     139            // 0 = menu_title, 1 = capability, 2 = menu_slug, 3 = page_title, 4 = classes
    140140            foreach ( $submenu_items as $sub_key => $sub_item ) {
    141141                if ( ! current_user_can( $sub_item[1] ) )
     
    168168                }
    169169
    170                 if ( ! empty( $sub_item[3] ) ) {
    171                     $class[] = $sub_item[3];
     170                if ( ! empty( $sub_item[4] ) ) {
     171                    $class[] = esc_attr( $sub_item[4] );
    172172                }
    173173
  • trunk/src/wp-admin/menu.php

    r29026 r29083  
    149149
    150150    $customize_url = add_query_arg( 'return', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'customize.php' );
    151     $submenu['themes.php'][6] = array( __( 'Customize' ), 'edit_theme_options', $customize_url, 'hide-if-no-customize' );
     151    $submenu['themes.php'][6] = array( __( 'Customize' ), 'edit_theme_options', $customize_url, '', 'hide-if-no-customize' );
    152152    unset( $customize_url );
    153153    if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
Note: See TracChangeset for help on using the changeset viewer.