Make WordPress Core


Ignore:
Timestamp:
09/28/2016 07:53:07 PM (8 years ago)
Author:
afercia
Message:

Administration: Improve the usage of the button CSS classes.

Introduces some consistency in the usage of the button CSS classes, fixes the
focus style for accessibility and responsiveness of the buttons.

  • Adds the button class to all primary buttons make them responsive
  • Removes all secondary-button classes and replaces it with button when needed. button-secondary shouldn't be used and exists just for backward compatibility reasons
  • Replaces classes inside submit_button() with a shorthand for some buttons, and use an empty string for the default button class. Passing button is unnecessary
  • Adjusts get_submit_button() to remove empty items

Props iseulde, dimchik, chris_d2d, mhowell, afercia.
Fixes #27314, #37138, #37448.

File:
1 edited

Legend:

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

    r37914 r38672  
    316316<?php
    317317    } else {
    318         submit_button( __( 'Delete' ), 'button alignleft', 'removewidget', false );
    319     }
    320     submit_button( __( 'Save Widget' ), 'button-primary alignright', 'savewidget', false ); ?>
     318        submit_button( __( 'Delete' ), 'alignleft', 'removewidget', false );
     319    }
     320    submit_button( __( 'Save Widget' ), 'primary alignright', 'savewidget', false ); ?>
    321321    <input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($widget_id); ?>" />
    322322    <input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr($id_base); ?>" />
     
    501501    <ul class="widgets-chooser-sidebars"></ul>
    502502    <div class="widgets-chooser-actions">
    503         <button class="button-secondary"><?php _e( 'Cancel' ); ?></button>
    504         <button class="button-primary"><?php _e( 'Add Widget' ); ?></button>
     503        <button class="button widgets-chooser-cancel"><?php _e( 'Cancel' ); ?></button>
     504        <button class="button button-primary widgets-chooser-add"><?php _e( 'Add Widget' ); ?></button>
    505505    </div>
    506506</div>
Note: See TracChangeset for help on using the changeset viewer.