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/media.php

    r38614 r38672  
    14811481
    14821482    if ( $r['send'] ) {
    1483         $r['send'] = get_submit_button( __( 'Insert into Post' ), 'button', "send[$attachment_id]", false );
     1483        $r['send'] = get_submit_button( __( 'Insert into Post' ), '', "send[$attachment_id]", false );
    14841484    }
    14851485
     
    20322032
    20332033<p class="savebutton ml-submit">
    2034 <?php submit_button( __( 'Save all changes' ), 'button', 'save', false ); ?>
     2034<?php submit_button( __( 'Save all changes' ), '', 'save', false ); ?>
    20352035</p>
    20362036</form>
     
    22432243
    22442244<p class="ml-submit">
    2245 <?php submit_button( __( 'Save all changes' ), 'button savebutton', 'save', false, array( 'id' => 'save-all', 'style' => 'display: none;' ) ); ?>
     2245<?php submit_button( __( 'Save all changes' ), 'savebutton', 'save', false, array( 'id' => 'save-all', 'style' => 'display: none;' ) ); ?>
    22462246<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
    22472247<input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" />
     
    23832383    <label class="screen-reader-text" for="media-search-input"><?php _e('Search Media');?>:</label>
    23842384    <input type="search" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
    2385     <?php submit_button( __( 'Search Media' ), 'button', '', false ); ?>
     2385    <?php submit_button( __( 'Search Media' ), '', '', false ); ?>
    23862386</p>
    23872387
     
    24802480<?php } ?>
    24812481
    2482 <?php submit_button( __( 'Filter &#187;' ), 'button', 'post-query-submit', false ); ?>
     2482<?php submit_button( __( 'Filter &#187;' ), '', 'post-query-submit', false ); ?>
    24832483
    24842484</div>
     
    25102510</div>
    25112511<p class="ml-submit">
    2512 <?php submit_button( __( 'Save all changes' ), 'button savebutton', 'save', false ); ?>
     2512<?php submit_button( __( 'Save all changes' ), 'savebutton', 'save', false ); ?>
    25132513<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
    25142514</p>
     
    26132613            <td></td>
    26142614            <td>
    2615                 ' . get_submit_button( __( 'Insert into Post' ), 'button', 'insertonlybutton', false ) . '
     2615                ' . get_submit_button( __( 'Insert into Post' ), '', 'insertonlybutton', false ) . '
    26162616            </td>
    26172617        </tr>
Note: See TracChangeset for help on using the changeset viewer.