WordPress.org

Make WordPress Core

Ticket #35879: p-field-css-classes.patch

File p-field-css-classes.patch, 2.4 KB (added by lkraav, 6 years ago)
  • wp-admin/includes/class-walker-nav-menu-edit.php

    Improve p.field-css-classes.description usability: switch to .description-wide
    
    From: Leho Kraav <leho@kraav.com>
    
    Menu item CSS class editor field is super narrow, for no obvious reason. For
    any class attribute list longer than a single element, this .description-thin
    control is just plain uncomfortable to use.
    
    .description-wide expands the field to 100% width and all is good.
    ---
     wp-admin/includes/class-walker-nav-menu-edit.php   |    2 +-
     .../class-wp-customize-nav-menu-item-control.php   |    2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/wp-admin/includes/class-walker-nav-menu-edit.php b/wp-admin/includes/class-walker-nav-menu-edit.php
    index b13e9d8..eb2e9c9 100644
    a b class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { 
    177177                                                <?php _e( 'Open link in a new tab' ); ?>
    178178                                        </label>
    179179                                </p>
    180                                 <p class="field-css-classes description description-thin">
     180                                <p class="field-css-classes description description-wide">
    181181                                        <label for="edit-menu-item-classes-<?php echo $item_id; ?>">
    182182                                                <?php _e( 'CSS Classes (optional)' ); ?><br />
    183183                                                <input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?>" class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?>]" value="<?php echo esc_attr( implode(' ', $item->classes ) ); ?>" />
  • wp-includes/customize/class-wp-customize-nav-menu-item-control.php

    diff --git a/wp-includes/customize/class-wp-customize-nav-menu-item-control.php b/wp-includes/customize/class-wp-customize-nav-menu-item-control.php
    index 466f214..4fa22fa 100644
    a b class WP_Customize_Nav_Menu_Item_Control extends WP_Customize_Control { 
    111111                                        <input type="text" id="edit-menu-item-attr-title-{{ data.menu_item_id }}" class="widefat edit-menu-item-attr-title" name="menu-item-attr-title" />
    112112                                </label>
    113113                        </p>
    114                         <p class="field-css-classes description description-thin">
     114                        <p class="field-css-classes description description-wide">
    115115                                <label for="edit-menu-item-classes-{{ data.menu_item_id }}">
    116116                                        <?php _e( 'CSS Classes' ); ?><br />
    117117                                        <input type="text" id="edit-menu-item-classes-{{ data.menu_item_id }}" class="widefat code edit-menu-item-classes" name="menu-item-classes" />