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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38672 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia
2016-09-28 19:53:07 +00:00
parent 02cf2a731f
commit ee7f970ffa
52 changed files with 126 additions and 125 deletions

View File

@@ -315,9 +315,9 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
<a href="widgets.php" class="button alignleft"><?php _e('Cancel'); ?></a>
<?php
} else {
submit_button( __( 'Delete' ), 'button alignleft', 'removewidget', false );
submit_button( __( 'Delete' ), 'alignleft', 'removewidget', false );
}
submit_button( __( 'Save Widget' ), 'button-primary alignright', 'savewidget', false ); ?>
submit_button( __( 'Save Widget' ), 'primary alignright', 'savewidget', false ); ?>
<input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($widget_id); ?>" />
<input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr($id_base); ?>" />
<input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr($multi_number); ?>" />
@@ -500,8 +500,8 @@ foreach ( $theme_sidebars as $sidebar => $registered_sidebar ) {
<div class="widgets-chooser">
<ul class="widgets-chooser-sidebars"></ul>
<div class="widgets-chooser-actions">
<button class="button-secondary"><?php _e( 'Cancel' ); ?></button>
<button class="button-primary"><?php _e( 'Add Widget' ); ?></button>
<button class="button widgets-chooser-cancel"><?php _e( 'Cancel' ); ?></button>
<button class="button button-primary widgets-chooser-add"><?php _e( 'Add Widget' ); ?></button>
</div>
</div>