WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/28/2010 09:56:43 PM (9 years ago)
Author:
markjaquith
Message:

Expand submit_button() capabilities. Replace all (or almost all) manual HTML instances in WP. props sbressler. see #15064

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r16057 r16061  
    12191219
    12201220    if ( $send )
    1221         $send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . esc_attr__( 'Insert into Post' ) . "' />";
     1221        $send = get_submit_button( __( 'Insert into Post' ), 'button', "send[$attachment_id]", false );
    12221222    if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) {
    12231223        if ( !EMPTY_TRASH_DAYS ) {
     
    14601460<?php do_action('pre-html-upload-ui'); ?>
    14611461    <p id="async-upload-wrap">
    1462     <label class="screen-reader-text" for="async-upload"><?php _e('Upload'); ?></label>
    1463     <input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php esc_attr_e('Upload'); ?>" /> <a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e('Cancel'); ?></a>
     1462        <label class="screen-reader-text" for="async-upload"><?php _e('Upload'); ?></label>
     1463        <input type="file" name="async-upload" id="async-upload" />
     1464        <?php submit_button( __( 'Upload' ), 'button', 'html-upload', false ); ?>
     1465        <a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e('Cancel'); ?></a>
    14641466    </p>
    14651467    <div class="clear"></div>
     
    14931495
    14941496<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form type-form validate" id="<?php echo $type; ?>-form">
    1495 <input type="submit" class="hidden" name="save" value="" />
     1497<?php submit_button( '', 'hidden', 'save', false ); ?>
    14961498<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
    14971499<?php wp_nonce_field('media-form'); ?>
     
    15261528</div>
    15271529<p class="savebutton ml-submit">
    1528 <input type="submit" class="button" name="save" value="<?php esc_attr_e( 'Save all changes' ); ?>" />
     1530<?php submit_button( __( 'Save all changes' ), 'button', 'save', false ); ?>
    15291531</p>
    15301532</form>
     
    17061708
    17071709<p class="ml-submit">
    1708 <input type="submit" class="button savebutton" style="display:none;" name="save" id="save-all" value="<?php esc_attr_e( 'Save all changes' ); ?>" />
     1710<?php submit_button( __( 'Save all changes' ), 'button savebutton', 'save', false, array( 'id' => 'save-all', 'style' => 'display: none;' ) ); ?>
    17091711<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
    17101712<input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" />
     
    18291831    <label class="screen-reader-text" for="media-search-input"><?php _e('Search Media');?>:</label>
    18301832    <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
    1831     <input type="submit" value="<?php esc_attr_e( 'Search Media' ); ?>" class="button" />
     1833    <?php submit_button( __( 'Search Media' ), 'button', '', false ); ?>
    18321834</p>
    18331835
     
    19161918<?php } ?>
    19171919
    1918 <input type="submit" id="post-query-submit" value="<?php echo esc_attr( __( 'Filter &#187;' ) ); ?>" class="button-secondary" />
     1920<?php submit_button( __( 'Filter &#187;' ), 'secondary', 'post-query-submit', false ); ?>
    19191921
    19201922</div>
     
    19461948</div>
    19471949<p class="ml-submit">
    1948 <input type="submit" class="button savebutton" name="save" value="<?php esc_attr_e( 'Save all changes' ); ?>" />
     1950<?php submit_button( __( 'Save all changes' ), 'button savebutton', 'save', false ); ?>
    19491951<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
    19501952</p>
     
    21442146            <td></td>
    21452147            <td>
    2146                 <input type="submit" class="button" name="insertonlybutton" value="' . esc_attr__('Insert into Post') . '" />
     2148                ' . get_submit_button( __( 'Insert into Post' ), 'button', 'insertonlybutton', false ) . '
    21472149            </td>
    21482150        </tr>
Note: See TracChangeset for help on using the changeset viewer.