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/custom-header.php

    r37914 r38672  
    577577        <input type="hidden" name="action" value="save" />
    578578        <?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ); ?>
    579         <?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
     579        <?php submit_button( __( 'Upload' ), '', 'submit', false ); ?>
    580580    </p>
    581581    <?php
     
    635635<td>
    636636    <p><?php _e( 'This will remove the header image. You will not be able to restore any customizations.' ) ?></p>
    637     <?php submit_button( __( 'Remove Header Image' ), 'button', 'removeheader', false ); ?>
     637    <?php submit_button( __( 'Remove Header Image' ), '', 'removeheader', false ); ?>
    638638</td>
    639639</tr>
     
    646646<td>
    647647    <p><?php _e( 'This will restore the original header image. You will not be able to restore any customizations.' ) ?></p>
    648     <?php submit_button( __( 'Restore Original Header Image' ), 'button', 'resetheader', false ); ?>
     648    <?php submit_button( __( 'Restore Original Header Image' ), '', 'resetheader', false ); ?>
    649649</td>
    650650</tr>
     
    824824    <?php
    825825    if ( isset( $oitar ) && 1 == $oitar && ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) )
    826         submit_button( __( 'Skip Cropping, Publish Image as Is' ), 'secondary', 'skip-cropping', false );
     826        submit_button( __( 'Skip Cropping, Publish Image as Is' ), '', 'skip-cropping', false );
    827827    ?>
    828828    </p>
Note: See TracChangeset for help on using the changeset viewer.