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/includes/class-wp-posts-list-table.php

    r38024 r38672  
    480480            do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
    481481
    482             submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
     482            submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
    483483        }
    484484
     
    17141714    ?>
    17151715        <p class="submit inline-edit-save">
    1716             <button type="button" class="button-secondary cancel alignleft"><?php _e( 'Cancel' ); ?></button>
     1716            <button type="button" class="button cancel alignleft"><?php _e( 'Cancel' ); ?></button>
    17171717            <?php if ( ! $bulk ) {
    17181718                wp_nonce_field( 'inlineeditnonce', '_inline_edit', false );
    17191719                ?>
    1720                 <button type="button" class="button-primary save alignright"><?php _e( 'Update' ); ?></button>
     1720                <button type="button" class="button button-primary save alignright"><?php _e( 'Update' ); ?></button>
    17211721                <span class="spinner"></span>
    17221722            <?php } else {
    1723                 submit_button( __( 'Update' ), 'button-primary alignright', 'bulk_edit', false );
     1723                submit_button( __( 'Update' ), 'primary alignright', 'bulk_edit', false );
    17241724            } ?>
    17251725            <input type="hidden" name="post_view" value="<?php echo esc_attr( $m ); ?>" />
Note: See TracChangeset for help on using the changeset viewer.