Ticket #15064: 15064.2.diff

File 15064.2.diff, 66.1 KB (added by sbressler, 3 years ago)

Replaces all remaining submit buttons in trunk, fixes some of scribu's changes in [15830]

  • wp-admin/comment.php

     
    180180<table width="100%"> 
    181181<tr> 
    182182<td><a class="button" href="<?php echo admin_url('edit-comments.php'); ?>"><?php esc_attr_e('No'); ?></a></td> 
    183 <td class="textright"><input type='submit' class="button" value='<?php echo esc_attr($button); ?>' /></td> 
     183<td class="textright"><?php submit_button( $button, 'button' ); ?></td> 
    184184</tr> 
    185185</table> 
    186186 
  • wp-admin/custom-background.php

     
    210210<td> 
    211211<form method="post" action=""> 
    212212<?php wp_nonce_field('custom-background-remove', '_wpnonce-custom-background-remove'); ?> 
    213 <input type="submit" class="button" name="remove-background" value="<?php esc_attr_e('Remove Background Image'); ?>" /><br/> 
     213<?php submit_button( __( 'Remove Background Image' ), 'button', 'remove-background', false ); ?><br/> 
    214214<?php _e('This will remove the background image. You will not be able to restore any customizations.') ?> 
    215215</form> 
    216216</td> 
     
    223223<td> 
    224224<form method="post" action=""> 
    225225<?php wp_nonce_field('custom-background-reset', '_wpnonce-custom-background-reset'); ?> 
    226 <input type="submit" class="button" name="reset-background" value="<?php esc_attr_e('Restore Original Image'); ?>" /><br/> 
     226<?php submit_button( __( 'Restore Original Image' ), 'button', 'reset-background', false ); ?><br/> 
    227227<?php _e('This will restore the original background image. You will not be able to restore any customizations.') ?> 
    228228</form> 
    229229</td> 
     
    236236<label for="upload"><?php _e('Choose an image from your computer:'); ?></label><br /><input type="file" id="upload" name="import" /> 
    237237<input type="hidden" name="action" value="save" /> 
    238238<?php wp_nonce_field('custom-background-upload', '_wpnonce-custom-background-upload') ?> 
    239 <input type="submit" class="button" value="<?php esc_attr_e('Upload'); ?>" /> 
     239<?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?> 
    240240</p> 
    241241</form> 
    242242</td> 
  • wp-admin/custom-header.php

     
    468468                <input type="file" id="upload" name="import" /> 
    469469                <input type="hidden" name="action" value="save" /> 
    470470                <?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ) ?> 
    471                 <input type="submit" class="button" value="<?php esc_attr_e( 'Upload' ); ?>" /> 
     471                <?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?> 
    472472        </p> 
    473473        </form> 
    474474</td> 
     
    501501<th scope="row"><?php _e( 'Remove Image' ); ?></th> 
    502502<td> 
    503503        <p><?php _e( 'This will remove the header image. You will not be able to restore any customizations.' ) ?></p> 
    504         <input type="submit" class="button" name="removeheader" value="<?php esc_attr_e( 'Remove Header Image' ); ?>" /> 
     504        <?php submit_button( __( 'Remove Header Image' ), 'button', 'removeheader', false ); ?> 
    505505</td> 
    506506</tr> 
    507507        <?php endif; 
     
    511511<th scope="row"><?php _e( 'Reset Image' ); ?></th> 
    512512<td> 
    513513        <p><?php _e( 'This will restore the original header image. You will not be able to restore any customizations.' ) ?></p> 
    514         <input type="submit" class="button" name="resetheader" value="<?php esc_attr_e( 'Restore Original Header Image' ); ?>" /> 
     514        <?php submit_button( __( 'Restore Original Header Image' ), 'button', 'resetheader', false ); ?> 
    515515</td> 
    516516</tr> 
    517517        <?php endif; ?> 
     
    550550<th scope="row"><?php _e('Reset Text Color'); ?></th> 
    551551<td> 
    552552        <p><?php _e( 'This will restore the original header text. You will not be able to restore any customizations.' ) ?></p> 
    553         <input type="submit" class="button" name="resettext" value="<?php esc_attr_e( 'Restore Original Header Text' ); ?>" /> 
     553        <?php submit_button( __( 'Restore Original Header Text' ), 'button', 'resettext', false ); ?> 
    554554</td> 
    555555</tr> 
    556556        <?php } ?> 
     
    563563 
    564564wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> 
    565565 
    566 <?php submit_button(); ?> 
     566<?php submit_button( null, 'primary', 'save-header-options' ); ?> 
    567567</form> 
    568568</div> 
    569569 
  • wp-admin/edit-comments.php

     
    202202<p class="search-box"> 
    203203        <label class="screen-reader-text" for="comment-search-input"><?php _e( 'Search Comments' ); ?>:</label> 
    204204        <input type="text" id="comment-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 
    205         <input type="submit" value="<?php esc_attr_e( 'Search Comments' ); ?>" class="button" /> 
     205        <?php submit_button( __( 'Search Comments' ), 'button', 'submit', false ); ?> 
    206206</p> 
    207207 
    208208<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" /> 
  • wp-admin/edit-form-comment.php

     
    7171<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( !EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?> 
    7272</div> 
    7373<div id="publishing-action"> 
    74 <input type="submit" name="save" value="<?php esc_attr_e('Update Comment'); ?>" tabindex="4" class="button-primary" /> 
     74<?php submit_button( __( 'Update Comment' ), 'primary', 'save', true, array( 'tabindex' => '4' ) ); ?> 
    7575</div> 
    7676<div class="clear"></div> 
    7777</div> 
  • wp-admin/edit-tags.php

     
    225225<p class="search-box"> 
    226226        <label class="screen-reader-text" for="tag-search-input"><?php echo $tax->labels->search_items; ?>:</label> 
    227227        <input type="text" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 
    228         <input type="submit" value="<?php echo esc_attr( $tax->labels->search_items );  ?>" class="button" /> 
     228        <?php submit_button( $tax->labels->search_items, 'button', 'submit', false ); ?> 
    229229</p> 
    230230</form> 
    231231<br class="clear" /> 
     
    334334if ( ! is_taxonomy_hierarchical($taxonomy) ) 
    335335        do_action('add_tag_form_fields', $taxonomy); 
    336336do_action($taxonomy . '_add_form_fields', $taxonomy); 
    337 ?> 
    338 <p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" /></p> 
    339 <?php 
     337 
     338submit_button( $tax->labels->add_new_item ); 
     339 
    340340// Back compat hooks. Deprecated in preference to {$taxonomy}_add_form 
    341341if ( 'category' == $taxonomy ) 
    342342        do_action('edit_category_form', (object)array('parent' => 0) ); 
  • wp-admin/edit.php

     
    223223<p class="search-box"> 
    224224        <label class="screen-reader-text" for="post-search-input"><?php echo $post_type_object->labels->search_items; ?>:</label> 
    225225        <input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" /> 
    226         <input type="submit" value="<?php echo esc_attr( $post_type_object->labels->search_items  ); ?>" class="button" /> 
     226        <?php submit_button( $post_type_object->labels->search_items, 'button', 'submit', false ); ?> 
    227227</p> 
    228228 
    229229<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" /> 
  • wp-admin/export.php

     
    5353<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.'); ?></p> 
    5454<p><?php _e('Once you&#8217;ve saved the download file, you can use the Import function on another WordPress site to import this site.'); ?></p> 
    5555<form action="" method="get"> 
    56 <?php submit_button( __('Download Export File'), 'secondary' ); ?> 
     56<?php submit_button( __('Download Export File'), 'button' ); ?> 
    5757<input type="hidden" name="download" value="true" /> 
    5858</p> 
    5959</form> 
  • wp-admin/includes/class-wp-list-table.php

     
    253253                        echo "\t<option value='$name'>$title</option>\n"; 
    254254                echo "</select>\n"; 
    255255 
    256                 echo "<input type='submit' value='" . esc_attr__( 'Apply' ) . "' name='doaction$two' id='doaction$two' class='button-secondary action' />\n"; 
     256                submit_button( __( 'Apply' ), 'button-secondary action', "doaction$two", false ); 
     257                echo "\n"; 
    257258        } 
    258259 
    259260        /** 
  • wp-admin/includes/dashboard.php

     
    479479                        <input type="hidden" name="quickpress_post_ID" value="<?php echo $post_ID; ?>" /> 
    480480                        <input type="hidden" name="post_type" value="post" /> 
    481481                        <?php wp_nonce_field('add-post'); ?> 
    482                         <input type="submit" name="save" id="save-post" class="button" tabindex="4" value="<?php esc_attr_e('Save Draft'); ?>" /> 
     482                        <?php submit_button( __( 'Save Draft' ), 'button', 'save', false, array( 'id' => 'save-post', 'tabindex'=> 4 ) ); ?> 
    483483                        <input type="reset" value="<?php esc_attr_e( 'Reset' ); ?>" class="button" /> 
    484484                        <span id="publishing-action"> 
    485485                                <input type="submit" name="publish" id="publish" accesskey="p" tabindex="5" class="button-primary" value="<?php current_user_can('publish_posts') ? esc_attr_e('Publish') : esc_attr_e('Submit for Review'); ?>" /> 
  • wp-admin/includes/file.php

     
    10371037        if ( isset( $_POST[ $field ] ) ) 
    10381038                echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( stripslashes( $_POST[ $field ] ) ) . '" />'; 
    10391039} 
     1040submit_button( __( 'Proceed' ), 'button', 'upgrade' ); 
    10401041?> 
    1041 <p class="submit"> 
    1042 <input id="upgrade" name="upgrade" type="submit" class="button" value="<?php esc_attr_e('Proceed'); ?>" /> 
    1043 </p> 
    10441042</div> 
    10451043</form> 
    10461044<?php 
  • wp-admin/includes/list-table-comments.php

     
    201201                                        echo "\t<option value='" . esc_attr( $type ) . "'" . selected( $comment_type, $type, false ) . ">$label</option>\n"; 
    202202                        ?> 
    203203                        </select> 
    204                         <input type="submit" id="post-query-submit" value="<?php esc_attr_e( 'Filter' ); ?>" class="button-secondary" /> 
    205204<?php 
     205                        submit_button( __( 'Filter' ), 'secondary', 'post-query-submit', false ); 
    206206                } 
    207207 
    208208                if ( ( 'spam' == $comment_status || 'trash' == $comment_status ) && current_user_can( 'moderate_comments' ) ) { 
    209209                        wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); 
    210210                        $title = ( 'spam' == $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' ); 
    211 ?> 
    212                         <input type="submit" name="delete_all" id="delete_all" value="<?php echo $title ?>" class="button-secondary apply" /> 
    213 <?php 
     211                        submit_button( $title, 'button-secondary apply', 'delete_all', false ); 
    214212                } 
    215 ?> 
    216 <?php 
    217213                do_action( 'manage_comments_nav', $comment_status ); 
    218214                echo '</div>'; 
    219215        } 
  • wp-admin/includes/list-table-links.php

     
    6969                                'orderby' => 'name', 
    7070                        ); 
    7171                        wp_dropdown_categories( $dropdown_options ); 
     72                        submit_button( __( 'Filter' ), 'secondary', 'post-query-submit', false ); 
    7273?> 
    73                         <input type="submit" id="post-query-submit" value="<?php esc_attr_e( 'Filter' ); ?>" class="button-secondary" /> 
    7474                </div> 
    7575<?php 
    7676        } 
  • wp-admin/includes/list-table-media.php

     
    9797                        $this->months_dropdown( $post_type ); 
    9898 
    9999                        do_action( 'restrict_manage_posts' ); 
    100 ?> 
    101                         <input type="submit" id="post-query-submit" value="<?php esc_attr_e( 'Filter' ); ?>" class="button-secondary" /> 
    102 <?php 
     100                        submit_button( __( 'Filter' ), 'secondary', 'post-query-submit', false ); 
    103101                } 
    104102 
    105                 if ( $detached ) { ?> 
    106                         <input type="submit" id="find_detached" name="find_detached" value="<?php esc_attr_e( 'Scan for lost attachments' ); ?>" class="button-secondary" /> 
    107                 <?php } elseif ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) { ?> 
    108                         <input type="submit" id="delete_all" name="delete_all" value="<?php esc_attr_e( 'Empty Trash' ); ?>" class="button-secondary apply" /> 
    109                 <?php } ?> 
     103                if ( $detached ) { 
     104                        submit_button( __( 'Scan for lost attachments' ), 'secondary', 'find_detached', false ); 
     105                } elseif ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) {  
     106                        submit_button( __( 'Empty Trash' ), 'button-secondary apply', 'delete_all', false ); 
     107                } ?> 
    110108                </div> 
    111109<?php 
    112110        } 
  • wp-admin/includes/list-table-plugins.php

     
    282282 
    283283                if ( 'recently_activated' == $status ) { ?> 
    284284                        <div class="alignleft actions"> 
    285                                 <input type="submit" name="clear-recent-list" value="<?php esc_attr_e( 'Clear List' ) ?>" class="button-secondary" /> 
     285                                <?php submit_button( __( 'Clear List' ), 'secondary', 'clear-recent-list', false ); ?> 
    286286                        </div> 
    287287                <?php } 
    288288        } 
  • wp-admin/includes/list-table-posts.php

     
    199199                                wp_dropdown_categories( $dropdown_options ); 
    200200                        } 
    201201                        do_action( 'restrict_manage_posts' ); 
     202                        submit_button( __( 'Filter' ), 'secondary', 'post-query-submit', false ); 
    202203?> 
    203                         <input type="submit" id="post-query-submit" value="<?php esc_attr_e( 'Filter' ); ?>" class="button-secondary" /> 
    204204                </div> 
    205205<?php 
    206206                } 
    207207 
    208208                if ( $this->is_trash && current_user_can( $post_type_object->cap->edit_others_posts ) ) { 
    209 ?> 
    210                 <input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e( 'Empty Trash' ); ?>" class="button-secondary apply" /> 
    211 <?php 
     209                        submit_button( __( 'Empty Trash' ), 'button-secondary apply', 'delete_all', false ); 
    212210                } 
    213211        } 
    214212 
     
    961959                                <a accesskey="s" href="#inline-edit" title="<?php _e( 'Update' ); ?>" class="button-primary save alignright"><?php echo esc_attr( $update_text ); ?></a> 
    962960                                <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /> 
    963961                        <?php } else { 
    964                                 $update_text = __( 'Update' ); 
    965                         ?> 
    966                                 <input accesskey="s" class="button-primary alignright" type="submit" name="bulk_edit" value="<?php echo esc_attr( $update_text ); ?>" /> 
    967                         <?php } ?> 
     962                                submit_button( __( 'Update' ), 'button-primary alignright', 'bulk_edit', false, array( 'accesskey' => 's' ) ); 
     963                        } ?> 
    968964                        <input type="hidden" name="post_view" value="<?php echo esc_attr( $m ); ?>" /> 
    969965                        <input type="hidden" name="screen" value="<?php echo esc_attr( $screen->id ); ?>" /> 
    970966                        <br class="clear" /> 
  • wp-admin/includes/list-table-users.php

     
    112112                        <option value=''><?php _e( 'Change role to&hellip;' ) ?></option> 
    113113                        <?php wp_dropdown_roles(); ?> 
    114114                </select> 
    115                 <input type="submit" value="<?php esc_attr_e( 'Change' ); ?>" name="changeit" class="button-secondary" /> 
     115                <?php submit_button( __( 'Change' ), 'secondary', 'changeit', false ); ?> 
    116116        </div> 
    117117<?php 
    118118        } 
  • wp-admin/includes/media.php

     
    12161216        ); 
    12171217 
    12181218        if ( $send ) 
    1219                 $send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . esc_attr__( 'Insert into Post' ) . "' />"; 
     1219                $send = get_submit_button( __( 'Insert into Post' ), 'button', "send[$attachment_id]", false ); 
    12201220        if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) { 
    12211221                if ( !EMPTY_TRASH_DAYS ) { 
    12221222                        $delete = "<a href='" . wp_nonce_url( "post.php?action=delete&amp;post=$attachment_id", 'delete-attachment_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete'>" . __( 'Delete Permanently' ) . '</a>'; 
     
    14571457<div id="html-upload-ui"> 
    14581458<?php do_action('pre-html-upload-ui'); ?> 
    14591459        <p id="async-upload-wrap"> 
    1460         <label class="screen-reader-text" for="async-upload"><?php _e('Upload'); ?></label> 
    1461         <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> 
     1460                <label class="screen-reader-text" for="async-upload"><?php _e('Upload'); ?></label> 
     1461                <input type="file" name="async-upload" id="async-upload" /> 
     1462                <?php submit_button( __( 'Upload' ), 'button', 'html-upload', false ); ?> 
     1463                <a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e('Cancel'); ?></a> 
    14621464        </p> 
    14631465        <div class="clear"></div> 
    14641466        <p class="media-upload-size"><?php printf( __( 'Maximum upload file size: %d%s' ), $upload_size_unit, $sizes[$u] ); ?></p> 
     
    14901492?> 
    14911493 
    14921494<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"> 
    1493 <input type="submit" class="hidden" name="save" value="" /> 
     1495<?php submit_button( '', 'hidden', 'save', false ); ?> 
    14941496<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> 
    14951497<?php wp_nonce_field('media-form'); ?> 
    14961498 
     
    15231525?> 
    15241526</div> 
    15251527<p class="savebutton ml-submit"> 
    1526 <input type="submit" class="button" name="save" value="<?php esc_attr_e( 'Save all changes' ); ?>" /> 
     1528<?php submit_button( __( 'Save all changes' ), 'button', 'save', false ); ?> 
    15271529</p> 
    15281530</form> 
    15291531<?php 
     
    17031705</div> 
    17041706 
    17051707<p class="ml-submit"> 
    1706 <input type="submit" class="button savebutton" style="display:none;" name="save" id="save-all" value="<?php esc_attr_e( 'Save all changes' ); ?>" /> 
     1708<?php submit_button( __( 'Save all changes' ), 'button savebutton', 'save', false, array( 'id' => 'save-all', 'style' => 'display: none;' ) ); ?> 
    17071709<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> 
    17081710<input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" /> 
    17091711<input type="hidden" name="tab" value="<?php echo esc_attr( $GLOBALS['tab'] ); ?>" /> 
     
    18261828<p id="media-search" class="search-box"> 
    18271829        <label class="screen-reader-text" for="media-search-input"><?php _e('Search Media');?>:</label> 
    18281830        <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" /> 
    1829         <input type="submit" value="<?php esc_attr_e( 'Search Media' ); ?>" class="button" /> 
     1831        <?php submit_button( __( 'Search Media' ), 'button', '', false ); ?> 
    18301832</p> 
    18311833 
    18321834<ul class="subsubsub"> 
     
    19131915</select> 
    19141916<?php } ?> 
    19151917 
    1916 <input type="submit" id="post-query-submit" value="<?php echo esc_attr( __( 'Filter &#187;' ) ); ?>" class="button-secondary" /> 
     1918<?php submit_button( __( 'Filter &#187;' ), 'secondary', 'post-query-submit', false ); ?> 
    19171919 
    19181920</div> 
    19191921 
     
    19431945<?php echo get_media_items(null, $errors); ?> 
    19441946</div> 
    19451947<p class="ml-submit"> 
    1946 <input type="submit" class="button savebutton" name="save" value="<?php esc_attr_e( 'Save all changes' ); ?>" /> 
     1948<?php submit_button( __( 'Save all changes' ), 'button savebutton', 'save', false ); ?> 
    19471949<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> 
    19481950</p> 
    19491951</form> 
     
    21412143                <tr> 
    21422144                        <td></td> 
    21432145                        <td> 
    2144                                 <input type="submit" class="button" name="insertonlybutton" value="' . esc_attr__('Insert into Post') . '" /> 
     2146                                ' . get_submit_button( __( 'Insert into Post' ), 'button', 'insertonlybutton', false ) . ' 
    21452147                        </td> 
    21462148                </tr> 
    21472149        '; 
  • wp-admin/includes/meta-boxes.php

     
    2222 
    2323<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?> 
    2424<div style="display:none;"> 
    25 <input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" /> 
     25<?php submit_button( __( 'Save' ), 'button', 'save' ); ?> 
    2626</div> 
    2727 
    2828<div id="minor-publishing-actions"> 
     
    211211        if ( $can_publish ) : 
    212212                if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> 
    213213                <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" /> 
    214                 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Schedule') ?>" /> 
     214                <?php submit_button( __( 'Schedule' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?> 
    215215<?php   else : ?> 
    216216                <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" /> 
    217                 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Publish') ?>" /> 
     217                <?php submit_button( __( 'Publish' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?> 
    218218<?php   endif; 
    219219        else : ?> 
    220220                <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" /> 
    221                 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Submit for Review') ?>" /> 
     221                <?php submit_button( __( 'Submit for Review' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?> 
    222222<?php 
    223223        endif; 
    224224} else { ?> 
     
    582582 
    583583<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?> 
    584584<div style="display:none;"> 
    585 <input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" /> 
     585<?php submit_button( __( 'Save' ), 'button', 'save', false ); ?> 
    586586</div> 
    587587 
    588588<div id="minor-publishing-actions"> 
  • wp-admin/includes/nav-menu.php

     
    495495        ?> 
    496496        <p class="button-controls"> 
    497497                <img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /> 
    498                 <input type="submit"<?php disabled( $nav_menu_selected_id, 0 ); ?> class="button-primary" name="nav-menu-locations" value="<?php esc_attr_e( 'Save' ); ?>" /> 
     498                <?php submit_button( __( 'Save' ), 'primary', 'nav-menu-locations', false, disabled( $nav_menu_selected_id, 0, false ) ); ?> 
    499499        </p> 
    500500        <?php 
    501501} 
     
    671671                        <p class="quick-search-wrap"> 
    672672                                <input type="text" class="quick-search regular-text input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" /> 
    673673                                <img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /> 
    674                                 <input type="submit" class="quick-search-submit button-secondary hide-if-js" value="<?php esc_attr_e('Search'); ?>" /> 
     674                                <?php submit_button( __( 'Search' ), 'quick-search-submit button-secondary hide-if-js', 'submit', false ); ?> 
    675675                        </p> 
    676676 
    677677                        <ul id="<?php echo $post_type_name; ?>-search-checklist" class="list:<?php echo $post_type_name?> categorychecklist form-no-clear"> 
     
    898898                        <p class="quick-search-wrap"> 
    899899                                <input type="text" class="quick-search regular-text input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" /> 
    900900                                <img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /> 
    901                                 <input type="submit" class="quick-search-submit button-secondary hide-if-js" value="<?php esc_attr_e('Search'); ?>" /> 
     901                                <?php submit_button( __( 'Search' ), 'quick-search-submit button-secondary hide-if-js', 'submit', false ); ?> 
    902902                        </p> 
    903903 
    904904                        <ul id="<?php echo $taxonomy_name; ?>-search-checklist" class="list:<?php echo $taxonomy_name?> categorychecklist form-no-clear"> 
  • wp-admin/includes/plugin-install.php

     
    129129                </select> 
    130130                <input type="text" name="s" value="<?php echo esc_attr($term) ?>" /> 
    131131                <label class="screen-reader-text" for="plugin-search-input"><?php _e('Search Plugins'); ?></label> 
    132                 <input type="submit" id="plugin-search-input" value="<?php esc_attr_e('Search Plugins'); ?>" class="button" /> 
     132                <?php submit_button( __( 'Search Plugins' ), 'button', 'plugin-search-input', false ); ?> 
    133133        </form><?php 
    134134} 
    135135 
  • wp-admin/includes/template.php

     
    495495        $r .= "\n\t<tr id='meta-{$entry['meta_id']}' class='$style'>"; 
    496496        $r .= "\n\t\t<td class='left'><label class='screen-reader-text' for='meta[{$entry['meta_id']}][key]'>" . __( 'Key' ) . "</label><input name='meta[{$entry['meta_id']}][key]' id='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' />"; 
    497497 
    498         $r .= "\n\t\t<div class='submit'><input name='deletemeta[{$entry['meta_id']}]' type='submit' "; 
    499         $r .= "class='delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta' tabindex='6' value='". esc_attr__( 'Delete' ) ."' />"; 
    500         $r .= "\n\t\t<input name='updatemeta' type='submit' tabindex='6' value='". esc_attr__( 'Update' ) ."' class='add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce updatemeta' /></div>"; 
     498        $r .= "\n\t\t<div class='submit'>"; 
     499        $r .= get_submit_button( __( 'Delete' ), "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta", "deletemeta[{$entry['meta_id']}]", false, array( 'tabindex' => '6' ) ); 
     500        $r .= "\n\t\t"; 
     501        $r .= get_submit_button( __( 'Update' ), "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce updatemeta" , 'updatemeta', false, array( 'tabindex' => '6' ) ); 
     502        $r .= "</div>"; 
    501503        $r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false ); 
    502504        $r .= "</td>"; 
    503505 
     
    557559</tr> 
    558560 
    559561<tr><td colspan="2" class="submit"> 
    560 <input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta" tabindex="9" value="<?php esc_attr_e( 'Add Custom Field' ) ?>" /> 
     562<?php submit_button( __( 'Add Custom Field' ), 'add:the-list:newmeta', 'addmeta', false, array( 'id' => 'addmetasub', 'tabindex' => '9' ) ); ?> 
    561563<?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?> 
    562564</td></tr> 
    563565</tbody> 
     
    843845<input type="hidden" name="action" value="save" /> 
    844846<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" /> 
    845847</p> 
    846 <?php submit_button( __('Upload file and import'), 'secondary' ); ?> 
     848<?php submit_button( __('Upload file and import'), 'button' ); ?> 
    847849</form> 
    848850<?php 
    849851        endif; 
     
    13571359                </div> 
    13581360                <div class="find-box-buttons"> 
    13591361                        <input id="find-posts-close" type="button" class="button alignleft" value="<?php esc_attr_e('Close'); ?>" /> 
    1360                         <input id="find-posts-submit" type="submit" class="button-primary alignright" value="<?php esc_attr_e('Select'); ?>" /> 
     1362                        <?php submit_button( __( 'Select' ), 'button-primary alignright', 'find-posts-submit', false ); ?> 
    13611363                </div> 
    13621364        </div> 
    13631365<?php 
     
    18891891        $return = "<div class='screen-options'>\n"; 
    18901892        if ( !empty($per_page_label) ) 
    18911893                $return .= "<input type='text' class='screen-per-page' name='wp_screen_options[value]' id='$option' maxlength='3' value='$per_page' /> <label for='$option'>$per_page_label</label>\n"; 
    1892         $return .= "<input type='submit' class='button' value='" . esc_attr__('Apply') . "' />"; 
     1894        $return .= get_submit_button( __( 'Apply' ), 'button', '', false ); 
    18931895        $return .= "<input type='hidden' name='wp_screen_options[option]' value='" . esc_attr($option) . "' />"; 
    18941896        $return .= "</div>\n"; 
    18951897        return $return; 
     
    20862088} 
    20872089 
    20882090/** 
    2089  * Echos a paragraph-wrapped submit button, with provided text and appropriate class 
     2091 * Echos a submit button, with provided text and appropriate class 
    20902092 * 
    20912093 * @since 3.1.0 
    20922094 * 
    20932095 * @param string $text The text of the button (defaults to 'Save Changes') 
    20942096 * @param string $type The type of button. One of: primary, secondary, delete 
    2095  * @param string $name The HTML name of the submit button. Defaults to "submit" 
     2097 * @param string $name The HTML name of the submit button. Defaults to "submit". If no id attribute 
     2098 *               is given in $other_attributes below, $name will be used as the button's id. 
     2099 * @param bool $wrap True if the output button should be wrapped in a paragraph tag, 
     2100 *                         false otherwise. Defaults to true 
     2101 * @param array|string $other_attributes Other attributes that should be output with the button, 
     2102 *                     mapping attributes to their values, such as array( 'tabindex' => '1' ). 
     2103 *                     These attributes will be ouput as attribute="value", such as tabindex="1". 
     2104 *                     Defaults to no other attributes. Other attributes can also be provided as a 
     2105 *                     string such as 'tabindex="1"', though the array format is typically cleaner. 
    20962106 */ 
    2097 function submit_button( $text = NULL, $type = 'primary', $name = 'submit' ) { 
    2098         echo get_submit_button( $text, $type, $name ); 
     2107function submit_button( $text = NULL, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = NULL ) { 
     2108        echo get_submit_button( $text, $type, $name, $wrap, $other_attributes ); 
    20992109} 
    21002110 
    21012111/** 
    2102  * Returns a paragraph-wrapped submit button, with provided text and appropriate class 
     2112 * Returns a submit button, with provided text and appropriate class 
    21032113 * 
    21042114 * @since 3.1.0 
    21052115 * 
    21062116 * @param string $text The text of the button (defaults to 'Save Changes') 
    21072117 * @param string $type The type of button. One of: primary, secondary, delete 
    2108  * @param string $name The HTML name of the submit button. Defaults to "submit" 
     2118 * @param string $name The HTML name of the submit button. Defaults to "submit". If no id attribute 
     2119 *               is given in $other_attributes below, $name will be used as the button's id. 
     2120 * @param bool $wrap True if the output button should be wrapped in a paragraph tag, 
     2121 *                         false otherwise. Defaults to true 
     2122 * @param array|string $other_attributes Other attributes that should be output with the button, 
     2123 *                     mapping attributes to their values, such as array( 'tabindex' => '1' ). 
     2124 *                     These attributes will be ouput as attribute="value", such as tabindex="1". 
     2125 *                     Defaults to no other attributes. Other attributes can also be provided as a 
     2126 *                     string such as 'tabindex="1"', though the array format is typically cleaner. 
    21092127 */ 
    2110 function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit' ) { 
     2128function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = NULL ) { 
    21112129        switch ( $type ) : 
    21122130                case 'primary' : 
    21132131                case 'secondary' : 
     
    21202138                        $class = $type; // Custom cases can just pass in the classes they want to be used 
    21212139        endswitch; 
    21222140        $text = ( NULL == $text ) ? __( 'Save Changes' ) : $text; 
    2123         return '<p class="submit"><input type="submit" name="' . esc_attr( $name ) . '" class="' . esc_attr( $class ) . '" value="' . esc_attr( $text ) . '" /></p>'; 
     2141         
     2142        $attributes = ''; 
     2143        if ( is_array( $other_attributes ) ) { 
     2144                foreach ( $other_attributes as $attribute => $value ) { 
     2145                        $attributes .= $attribute . '="' . esc_attr( $value ) . '" '; // Trailing space is important 
     2146                } 
     2147        } else if ( !empty( $other_attributes ) ) { // Attributes provided as a string 
     2148                $attributes = $other_attributes; 
     2149        } 
     2150         
     2151        // Default the id attribute to $name unless an id was specifically provided in $other_attributes 
     2152        $id = 'id="' . esc_attr( $name ) . '" '; 
     2153        if ( is_array( $other_attributes ) && array_key_exists( 'id', $other_attributes ) ) { 
     2154                $id = 'id="' . esc_attr( $other_attributes['id'] ) . '" '; 
     2155        } 
     2156         
     2157        $button = '<input type="submit" name="' . esc_attr( $name ) . '" id="' . $id . '" class="' . esc_attr( $class ); 
     2158        $button .= '" value="' . esc_attr( $text ) . '" ' . $attributes . ' />'; 
     2159         
     2160        if ( $wrap ) { 
     2161                $button = '<p class="submit">' . $button . '</p>'; 
     2162        } 
     2163         
     2164        return $button; 
    21242165} 
    21252166 
  • wp-admin/includes/theme-install.php

     
    6363        <option value="tag" <?php selected('tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option> 
    6464        </select> 
    6565        <input type="text" name="s" size="30" value="<?php echo esc_attr($term) ?>" /> 
    66         <input type="submit" name="search" value="<?php esc_attr_e('Search'); ?>" class="button" /> 
     66        <?php submit_button( __( 'Search' ), 'button', 'search', false ); ?> 
    6767</form> 
    6868<?php 
    6969} 
     
    106106 
    107107</div> 
    108108<br class="clear" /> 
    109 <p><input type="submit" name="search" value="<?php esc_attr_e('Find Themes'); ?>" class="button" /></p> 
     109<?php submit_button( __( 'Find Themes' ), 'button', 'search' ); ?> 
    110110</form> 
    111111<?php 
    112112} 
     
    119119<form method="post" enctype="multipart/form-data" action="<?php echo self_admin_url('update.php?action=upload-theme') ?>"> 
    120120        <?php wp_nonce_field( 'theme-upload') ?> 
    121121        <input type="file" name="themezip" /> 
    122         <input type="submit" 
    123         class="button" value="<?php esc_attr_e('Install Now') ?>" /> 
     122        <?php submit_button( __( 'Install Now' ), 'button', '', false ); ?> 
    124123</form> 
    125124        <?php 
    126125} 
  • wp-admin/includes/widgets.php

     
    203203                </div> 
    204204                <div class="alignright<?php if ( 'noform' === $has_form ) echo ' widget-control-noform'; ?>"> 
    205205                <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-feedback " title="" alt="" /> 
    206                 <input type="submit" name="savewidget" class="button-primary widget-control-save" value="<?php esc_attr_e('Save'); ?>" /> 
     206                <?php submit_button( __( 'Save' ), 'button-primary widget-control-save', 'savewidget', false ); ?> 
    207207                </div> 
    208208                <br class="clear" /> 
    209209        </div> 
  • wp-admin/install.php

     
    133133                        <td colspan="2"><label><input type="checkbox" name="blog_public" value="1" <?php checked( $blog_public ); ?> /> <?php _e( 'Allow my site to appear in search engines like Google and Technorati.' ); ?></label></td> 
    134134                </tr> 
    135135        </table> 
    136         <p class="step"><input type="submit" name="Submit" value="<?php esc_attr_e( 'Install WordPress' ); ?>" class="button" /></p> 
     136        <p class="step"><?php submit_button( __( 'Install WordPress' ), 'button', 'Submit', false ); ?></p> 
    137137</form> 
    138138<?php 
    139139} // end display_setup_form() 
  • wp-admin/link-manager.php

     
    7676<p class="search-box"> 
    7777        <label class="screen-reader-text" for="link-search-input"><?php _e( 'Search Links' ); ?>:</label> 
    7878        <input type="text" id="link-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 
    79         <input type="submit" value="<?php esc_attr_e( 'Search Links' ); ?>" class="button" /> 
     79        <?php submit_button( __( 'Search Links' ), 'button', '', false ); ?> 
    8080</p> 
    8181</form> 
    8282<br class="clear" /> 
  • wp-admin/media-upload.php

     
    9090        <input type="hidden" name="post_id" id="post_id" value="0" /> 
    9191        <?php wp_nonce_field('media-form'); ?> 
    9292        <div id="media-items" class="hide-if-no-js"> </div> 
    93         <p> 
    94         <input type="submit" class="button savebutton hide-if-no-js" name="save" value="<?php esc_attr_e( 'Save all changes' ); ?>" /> 
    95         </p> 
     93        <?php submit_button( __( 'Save all changes' ), 'button savebutton hide-if-no-js', 'save' ); ?> 
    9694        </form> 
    9795        </div> 
    9896 
  • wp-admin/media.php

     
    9191 
    9292<form method="post" action="" class="media-upload-form" id="media-single-form"> 
    9393<p class="submit" style="padding-bottom: 0;"> 
    94 <input type="submit" class="button-primary" name="save" value="<?php esc_attr_e('Update Media'); ?>" /> 
     94<?php submit_button( __( 'Update Media' ), 'primary', 'save', false ); ?> 
    9595</p> 
    9696 
    9797<div class="media-single"> 
     
    100100</div> 
    101101</div> 
    102102 
    103 <?php submit_button( __('Update Media') ); ?> 
     103<?php submit_button( __( 'Update Media' ), 'primary', 'save' ); ?> 
    104104<input type="hidden" name="post_id" id="post_id" value="<?php echo isset($post_id) ? esc_attr($post_id) : ''; ?>" /> 
    105105<input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo esc_attr($att_id); ?>" /> 
    106106<input type="hidden" name="action" value="editattachment" /> 
  • wp-admin/ms-delete-site.php

     
    7070        <form method="post" name="deletedirect"> 
    7171                <input type="hidden" name="action" value="deleteblog" /> 
    7272                <p><input id="confirmdelete" type="checkbox" name="confirmdelete" value="1" /> <label for="confirmdelete"><strong><?php printf( __( "I'm sure I want to permanently disable my site, and I am aware I can never get it back or use %s again." ), is_subdomain_install() ? $current_blog->domain : $current_blog->domain . $current_blog->path ); ?></strong></label></p> 
    73                 <p class="submit"><input type="submit" value="<?php esc_attr_e( 'Delete My Site Permanently' ) ?>" /></p> 
     73                <?php submit_button( __( 'Delete My Site Permanently' ) ); ?> 
    7474        </form> 
    7575        <?php 
    7676} 
  • wp-admin/my-sites.php

     
    102102        </table> 
    103103        <input type="hidden" name="action" value="updateblogsettings" /> 
    104104        <?php wp_nonce_field( 'update-my-sites' ); ?> 
    105         <p> 
    106          <input type="submit" class="button-primary" value="<?php _e( 'Save Changes' ) ?>" /> 
    107         </p> 
     105        <?php submit_button(); ?> 
    108106        </form> 
    109107        </div> 
    110108<?php 
  • wp-admin/nav-menus.php

     
    494494                                                <option value="0"><?php esc_html_e('Add New Menu'); ?></option> 
    495495                                        </select> 
    496496                                        <input type="hidden" name="action" value="edit" /> 
    497                                         <input class="button-secondary" name="select_menu" type="submit" value="<?php esc_attr_e('Select'); ?>" /> 
     497                                        <?php submit_button( __( 'Select' ), 'secondary', 'select_menu', false ); ?> 
    498498                                </form> 
    499499                        </div> 
    500500                        <div class="nav-tabs-wrapper"> 
     
    556556                                                                <?php endif; ?> 
    557557                                                                <br class="clear" /> 
    558558                                                                <div class="publishing-action"> 
    559                                                                         <input class="button-primary menu-save" name="save_menu" type="submit" value="<?php empty($nav_menu_selected_id) ? esc_attr_e('Create Menu') : esc_attr_e('Save Menu'); ?>" /> 
     559                                                                        <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false ); ?> 
    560560                                                                </div><!-- END .publishing-action --> 
    561561 
    562562                                                                <?php if ( ! empty( $nav_menu_selected_id ) ) : ?> 
     
    593593                                        <div id="nav-menu-footer"> 
    594594                                                <div class="major-publishing-actions"> 
    595595                                                <div class="publishing-action"> 
    596                                                         <input class="button-primary menu-save" name="save_menu" type="submit" value="<?php empty($nav_menu_selected_id) ? esc_attr_e('Create Menu') : esc_attr_e('Save Menu'); ?>" /> 
     596                                                        <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false ); ?> 
    597597                                                </div> 
    598598                                                </div> 
    599599                                        </div><!-- /#nav-menu-footer --> 
  • wp-admin/network.php

     
    275275                                </td> 
    276276                        </tr> 
    277277                </table> 
    278                 <p class='submit'><input class="button-primary" name='submit' type='submit' value='<?php esc_attr_e( 'Install' ); ?>' /></p> 
     278                <?php submit_button( __( 'Install' ), 'primary', 'submit' ); ?> 
    279279        </form> 
    280                 <?php 
     280        <?php 
    281281} 
    282282 
    283283/** 
  • wp-admin/network/edit.php

     
    347347                                        <input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" /> 
    348348                                        <?php wp_nonce_field( $_GET['action2'], '_wpnonce', false ); ?> 
    349349                                        <p><?php echo esc_html( stripslashes( $_GET['msg'] ) ); ?></p> 
    350                                         <?php submit_button( __('Confirm'), 'secondary' ); ?> 
     350                                        <?php submit_button( __('Confirm'), 'button' ); ?> 
    351351                                </form> 
    352352                        </body> 
    353353                </html> 
  • wp-admin/network/sites.php

     
    110110                <p class="search-box"> 
    111111                <input type="hidden" name="action" value="blogs" /> 
    112112                <input type="text" name="s" value="<?php echo esc_attr( $s ); ?>" /> 
    113                 <input type="submit" class="button" value="<?php esc_attr_e( 'Search Site by' ) ?>" /> 
     113                <?php submit_button( __( 'Search Site by' ), 'button', 'submit', false ); ?> 
    114114                <select name="searchaction"> 
    115115                        <option value="name" selected="selected"><?php _e( 'Name' ); ?></option> 
    116116                        <option value="id"><?php _e( 'ID' ); ?></option> 
  • wp-admin/network/themes.php

     
    4040                <?php screen_icon(); ?> 
    4141                <h2><?php _e( 'Network Themes' ) ?></h2> 
    4242                <p><?php _e( 'Themes must be enabled for your network before they will be available to individual sites.' ) ?></p> 
    43                 <p class="submit"> 
    44                         <input type="submit" value="<?php _e( 'Apply Changes' ) ?>" /></p> 
     43                <?php submit_button( __( 'Apply Changes' ), '', '' ); ?> 
    4544                <table class="widefat"> 
    4645                        <thead> 
    4746                                <tr> 
     
    8382                        <?php } ?> 
    8483                        </tbody> 
    8584                </table> 
    86  
    87                 <p class="submit"> 
    88                         <input type="submit" value="<?php _e( 'Apply Changes' ) ?>" /></p> 
     85                 
     86                <?php submit_button( __( 'Apply Changes' ), '', '' ); ?> 
    8987        </form> 
    9088 
    9189        <h3><?php _e( 'Total' )?></h3> 
  • wp-admin/network/users.php

     
    7373        <form action="" method="get" class="search-form"> 
    7474                <p class="search-box"> 
    7575                <input type="text" name="s" value="<?php echo esc_attr( $usersearch ); ?>" class="search-input" id="user-search-input" /> 
    76                 <input type="submit" id="post-query-submit" value="<?php esc_attr_e( 'Search Users' ) ?>" class="button" /> 
     76                <?php submit_button( __( 'Search Users' ), 'button', 'post-query-submit', false ); ?> 
    7777                </p> 
    7878        </form> 
    7979 
  • wp-admin/options.php

     
    212212 
    213213<input type="hidden" name="page_options" value="<?php echo esc_attr( implode( ',', $options_to_update ) ); ?>" /> 
    214214 
    215 <?php submit_button( __('Save Changes') ); ?> 
     215<?php submit_button( __( 'Save Changes' ), 'primary', 'Update' ); ?> 
    216216 
    217217  </form> 
    218218</div> 
  • wp-admin/plugin-editor.php

     
    185185        } 
    186186?> 
    187187                </select> 
    188                 <input type="submit" name="Submit" value="<?php esc_attr_e('Select') ?>" class="button" /> 
     188                <?php submit_button( __( 'Select' ), 'button', 'Submit', false ); ?> 
    189189        </form> 
    190190</div> 
    191191<br class="clear" /> 
     
    229229        <?php } ?> 
    230230        <p class="submit"> 
    231231        <?php 
    232                 if ( isset($_GET['phperror']) ) 
    233                         echo "<input type='hidden' name='phperror' value='1' /><input type='submit' name='submit' class='button-primary' value='" . esc_attr__('Update File and Attempt to Reactivate') . "' tabindex='2' />"; 
    234                 else 
    235                         echo "<input type='submit' name='submit' class='button-primary' value='" . esc_attr__('Update File') . "' tabindex='2' />"; 
     232                if ( isset($_GET['phperror']) ) { 
     233                        echo "<input type='hidden' name='phperror' value='1' />"; 
     234                        submit_button( __( 'Update File and Attempt to Reactivate' ), 'primary', 'submit', false, array( 'tabindex' => '2' ) ); 
     235                } else { 
     236                        submit_button( __( 'Update File' ), 'primary', 'submit', false, array( 'tabindex' => '2' ) ); 
     237                } 
    236238        ?> 
    237239        </p> 
    238240<?php else : ?> 
  • wp-admin/plugins.php

     
    253253                                                        echo '<input type="hidden" name="checked[]" value="' . esc_attr($plugin) . '" />'; 
    254254                                        ?> 
    255255                                        <?php wp_nonce_field('bulk-plugins') ?> 
    256                                         <input type="submit" name="submit" value="<?php $data_to_delete ? esc_attr_e('Yes, Delete these files and data') : esc_attr_e('Yes, Delete these files') ?>" class="button" /> 
     256                                        <?php submit_button( $data_to_delete ? __( 'Yes, Delete these files and data' ) : __( 'Yes, Delete these files' ), 'button', 'submit', false ); ?> 
    257257                                </form> 
    258258                                <form method="post" action="<?php echo esc_url(wp_get_referer()); ?>" style="display:inline;"> 
    259                                         <input type="submit" name="submit" value="<?php esc_attr_e('No, Return me to the plugin list') ?>" class="button" /> 
     259                                        <?php submit_button( __( 'No, Return me to the plugin list' ), 'button', 'submit', false ); ?> 
    260260                                </form> 
    261261 
    262262                                <p><a href="#" onclick="jQuery('#files-list').toggle(); return false;"><?php _e('Click to view entire list of files which will be deleted'); ?></a></p> 
     
    357357<p class="search-box"> 
    358358        <label class="screen-reader-text" for="plugin-search-input"><?php _e( 'Search Plugins' ); ?>:</label> 
    359359        <input type="text" id="plugin-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 
    360         <input type="submit" value="<?php esc_attr_e( 'Search Installed Plugins' ); ?>" class="button" /> 
     360        <?php submit_button( __( 'Search Installed Plugins' ), 'button', '', false ); ?> 
    361361</p> 
    362362</form> 
    363363 
  • wp-admin/press-this.php

     
    472472                                <h3><?php _e('Publish') ?></h3> 
    473473                                <div class="inside"> 
    474474                                        <p> 
    475                                                 <input class="button" type="submit" name="draft" value="<?php esc_attr_e('Save Draft') ?>" id="save" /> 
    476                                                 <?php if ( current_user_can('publish_posts') ) { ?> 
    477                                                         <input class="button-primary" type="submit" name="publish" value="<?php esc_attr_e('Publish') ?>" id="publish" /> 
    478                                                 <?php } else { ?> 
    479                                                         <br /><br /><input class="button-primary" type="submit" name="review" value="<?php esc_attr_e('Submit for Review') ?>" id="review" /> 
    480                                                 <?php } ?> 
     475                                        <?php 
     476                                                submit_button( __( 'Save Draft' ), 'button', 'draft', false, array( 'id' => 'save' ) ); 
     477                                                if ( current_user_can('publish_posts') ) { 
     478                                                        submit_button( __( 'Publish' ), 'primary', 'publish', false ); 
     479                                                } else { 
     480                                                        echo '<br /><br />'; 
     481                                                        submit_button( __( 'Submit for Review' ), 'primary', 'review', false ); 
     482                                                } ?> 
    481483                                                <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="saving" style="display:none;" /> 
    482484                                        </p> 
    483485                                </div> 
  • wp-admin/setup-config.php

     
    146146                </tr> 
    147147        </table> 
    148148        <?php if ( isset( $_GET['noapi'] ) ) { ?><input name="noapi" type="hidden" value="true" /><?php } ?> 
    149         <p class="step"><input name="submit" type="submit" value="Submit" class="button" /></p> 
     149        <p class="step"><?php submit_button( __( 'Submit' ), 'button', 'submit', false ); ?></p> 
    150150</form> 
    151151<?php 
    152152        break; 
  • wp-admin/theme-editor.php

     
    149149} 
    150150?> 
    151151                </select> 
    152                 <input type="submit" name="Submit" value="<?php esc_attr_e('Select') ?>" class="button" /> 
     152                <?php submit_button( __( 'Select' ), 'button', 'Submit', false ); ?> 
    153153        </form> 
    154154</div> 
    155155<br class="clear" /> 
     
    224224        <?php } ?> 
    225225 
    226226                <div> 
    227 <?php if ( is_writeable($file) ) : ?> 
    228                         <p class="submit"> 
    229227<?php 
    230         echo "<input type='submit' name='submit' class='button-primary' value='" . esc_attr__('Update File') . "' tabindex='2' />"; 
    231 ?> 
    232 </p> 
    233 <?php else : ?> 
     228        if ( is_writeable($file) ) : 
     229                submit_button( __( 'Update File' ), 'primary', 'submit', true, array( 'tabindex' => '2' ) ); 
     230        else : ?> 
    234231<p><em><?php _e('You need to make this file writable before you can save your changes. See <a href="http://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.'); ?></em></p> 
    235232<?php endif; ?> 
    236233                </div> 
  • wp-admin/themes.php

     
    133133<p class="search-box"> 
    134134        <label class="screen-reader-text" for="theme-search-input"><?php _e('Search Themes'); ?>:</label> 
    135135        <input type="text" id="theme-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 
    136         <input type="submit" value="<?php esc_attr_e('Search Themes'); ?>" class="button" /> 
     136        <?php submit_button( __( 'Search Themes' ), 'button', 'submit', false ); ?> 
    137137        <a id="filter-click" href="?filter=1"><?php _e( 'Feature Filter' ); ?></a> 
    138138</p> 
    139139 
     
    166166        <?php endforeach; ?> 
    167167 
    168168        <div class="feature-container"> 
    169                 <input style="margin-left: 120px" type="submit" class="button-secondary submitter" value="<?php esc_attr_e( 'Apply Filters' ); ?>" /> 
     169                <?php submit_button( __( 'Apply Filters' ), 'button-secondary submitter', 'submit', false, array( 'style' => 'margin-left: 120px' ) ); ?> 
    170170                &nbsp; 
    171171                <small><a id="mini-filter-click" href="<?php echo admin_url( 'themes.php' ); ?>"><?php _e( 'Close filters' )?></a></small> 
    172172        </div> 
  • wp-admin/update-core.php

     
    5858        echo '<input name="version" value="'. esc_attr($update->current) .'" type="hidden"/>'; 
    5959        echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>'; 
    6060        if ( $show_buttons ) { 
    61                 echo '<input id="upgrade" class="button" type="submit" value="' . esc_attr($submit) . '" name="upgrade" />&nbsp;'; 
    62                 echo '<a href="' . esc_url($update->package) . '" class="button">' . $download . '</a>&nbsp;'; 
     61                submit_button( $submit, 'button', 'upgrade', false ); 
     62                echo '&nbsp;<a href="' . esc_url($update->package) . '" class="button">' . $download . '</a>&nbsp;'; 
    6363        } 
    6464        if ( 'en_US' != $update->locale ) 
    6565                if ( !isset( $update->dismissed ) || !$update->dismissed ) 
    66                         echo '<input id="dismiss" class="button" type="submit" value="' . esc_attr__('Hide this update') . '" name="dismiss" />'; 
     66                        submit_button( __('Hide this update'), 'button', 'dismiss', false ); 
    6767                else 
    68                         echo '<input id="undismiss" class="button" type="submit" value="' . esc_attr__('Bring back this update') . '" name="undismiss" />'; 
     68                        submit_button( __('Bring back this update'), 'button', 'undismiss', false ); 
    6969        echo '</p>'; 
    7070        if ( 'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) ) 
    7171            echo '<p class="hint">'.__('This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.').'</p>'; 
  • wp-admin/upload.php

     
    206206<p class="search-box"> 
    207207        <label class="screen-reader-text" for="media-search-input"><?php _e( 'Search Media' ); ?>:</label> 
    208208        <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" /> 
    209         <input type="submit" value="<?php esc_attr_e( 'Search Media' ); ?>" class="button" /> 
     209        <?php submit_button( __( 'Search Media' ), 'button', 'submit', false ); ?> 
    210210</p> 
    211211</form> 
    212212 
  • wp-admin/user-new.php

     
    265265        </tr> 
    266266        <?php } ?> 
    267267</table> 
    268  
    269 <?php submit_button( __('Add User'), 'primary', 'adduser' ); ?> 
     268<p class="submit"> 
     269        <input name="adduser" type="submit" id="addusersub" class="button-primary" value="<?php esc_attr_e('Add User') ?>" /> 
     270</p> 
    270271</form> 
    271272 
    272273</div> 
  • wp-admin/users.php

     
    360360<p class="search-box"> 
    361361        <label class="screen-reader-text" for="user-search-input"><?php _e( 'Search Users' ); ?>:</label> 
    362362        <input type="text" id="user-search-input" name="usersearch" value="<?php echo esc_attr($usersearch); ?>" /> 
    363         <input type="submit" value="<?php esc_attr_e( 'Search Users' ); ?>" class="button" /> 
     363        <?php submit_button( __( 'Search Users' ), 'submit', 'submit', false ); ?> 
    364364</p> 
    365365</form> 
    366366 
  • wp-admin/widgets.php

     
    306306        </div> 
    307307 
    308308        <div class="widget-control-actions"> 
    309 <?php   if ( isset($_GET['addnew']) ) { ?> 
     309<?php 
     310        if ( isset($_GET['addnew']) ) { ?> 
    310311        <a href="widgets.php" class="button alignleft"><?php _e('Cancel'); ?></a> 
    311 <?php   } else { ?> 
    312         <input type="submit" name="removewidget" class="button alignleft" value="<?php esc_attr_e('Delete'); ?>" /> 
    313 <?php   } ?> 
    314         <input type="submit" name="savewidget" class="button-primary alignright" value="<?php esc_attr_e('Save Widget'); ?>" /> 
     312<?php 
     313        } else { 
     314                submit_button( __( 'Delete' ), 'button alignleft', 'removewidget', false );  
     315        } 
     316        submit_button( __( 'Save Widget' ), 'button-primary alignright', 'savewidget', false ); ?> 
    315317        <input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($widget_id); ?>" /> 
    316318        <input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr($id_base); ?>" /> 
    317319        <input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr($multi_number); ?>" /> 
  • wp-includes/comment-template.php

     
    15721572                                                <?php echo apply_filters( 'comment_form_field_comment', $args['comment_field'] ); ?> 
    15731573                                                <?php echo $args['comment_notes_after']; ?> 
    15741574                                                <p class="form-submit"> 
    1575                                                         <input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" /> 
     1575                                                        <?php submit_button( $args['label_submit'], 'button', 'submit', false, array( 'id' => $args['id_submit'] ) ); ?> 
    15761576                                                        <?php comment_id_fields(); ?> 
    15771577                                                </p> 
    15781578                                                <?php do_action( 'comment_form', $post_id ); ?> 
  • wp-includes/general-template.php

     
    160160        $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" > 
    161161        <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label> 
    162162        <input type="text" value="' . get_search_query() . '" name="s" id="s" /> 
    163         <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" /> 
     163        ' . get_submit_button( __( 'Search' ), '', 'searchsubmit', false ) . ' 
    164164        </div> 
    165165        </form>'; 
    166166 
     
    283283                        ' . apply_filters( 'login_form_middle', '' ) . ' 
    284284                        ' . ( $args['remember'] ? '<p class="login-remember"><label><input name="rememberme" type="checkbox" id="' . esc_attr( $args['id_remember'] ) . '" value="forever" tabindex="90"' . ( $args['value_remember'] ? ' checked="checked"' : '' ) . ' /> ' . esc_html( $args['label_remember'] ) . '</label></p>' : '' ) . ' 
    285285                        <p class="login-submit"> 
    286                                 <input type="submit" name="wp-submit" id="' . esc_attr( $args['id_submit'] ) . '" class="button-primary" value="' . esc_attr( $args['label_log_in'] ) . '" tabindex="100" /> 
     286                        ' . get_submit_button( $args['label_log_in'], 'primary', 'wp-submit', false, array( 'id' => $args['id_submit'], 'tabindex' => 100 ) ) . ' 
    287287                                <input type="hidden" name="redirect_to" value="' . esc_attr( $args['redirect'] ) . '" /> 
    288288                        </p> 
    289289                        ' . apply_filters( 'login_form_bottom', '' ) . ' 
  • wp-includes/post-template.php

     
    10131013        $label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID); 
    10141014        $output = '<form action="' . get_option('siteurl') . '/wp-pass.php" method="post"> 
    10151015        <p>' . __("This post is password protected. To view it please enter your password below:") . '</p> 
    1016         <p><label for="' . $label . '">' . __("Password:") . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__("Submit") . '" /></p> 
     1016        <p> 
     1017                <label for="' . $label . '">' . __("Password:") . ' 
     1018                        <input name="post_password" id="' . $label . '" type="password" size="20" /> 
     1019                </label>' . get_submit_button( __( 'Submit' ), '', 'Submit', false ) . ' 
     1020        </p> 
    10171021        </form> 
    10181022        '; 
    10191023        return apply_filters('the_password_form', $output); 
     
    11961200 
    11971201<div class="tablenav"> 
    11981202        <div class="alignleft"> 
    1199                 <input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Compare Revisions' ); ?>" /> 
     1203                <?php submit_button( __( 'Compare Revisions' ), 'secondary', '', false ); ?> 
    12001204                <input type="hidden" name="action" value="diff" /> 
    12011205                <input type="hidden" name="post_type" value="<?php echo esc_attr($post->post_type); ?>" /> 
    12021206        </div> 
  • wp-includes/post.php

     
    51015101        ); 
    51025102 
    51035103        $submit_fields = array( 
    5104                 'save' => '<input type="submit" name="save" id="save-post" class="button" tabindex="%s" value="'.  esc_attr('Save Draft') .'" />', 
     5104                'save' => get_submit_button( __( 'Save Draft' ), 'button', 'save', false, array( 'id' => 'save-post', 'tabindex' => '%s' ) ), 
    51055105                'reset' => '<input type="reset" tabindex="%s" value="'. esc_attr( 'Reset' ).'" class="button" />', 
    51065106        ); 
    51075107 
    51085108        $publishing_action = current_user_can('publish_posts') ? esc_attr('Publish') : esc_attr('Submit for Review'); 
    51095109 
    51105110        $publishing_fields = array( 
    5111         'submit' => '<input type="submit" name="publish" id="publish" accesskey="p" tabindex="%s" class="button-primary" value="' . $publishing_action . '" />', 
     5111        'submit' => get_submit_button( $publishing_action, 'primary', 'publish', false, array( 'accesskey' => 'p', 'tabindex' => '%s' ) ), 
    51125112        /*'test' => '<input type="submit" name="publish" id="publish" accesskey="p" tabindex="%n" class="button-primary" value="'. esc_attr('Publish') .'" />', */ 
    51135113 
    51145114        ); 
  • wp-includes/theme-compat/comments-popup.php

     
    9595        <p> 
    9696          <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> 
    9797          <input type="hidden" name="redirect_to" value="<?php echo esc_attr($_SERVER["REQUEST_URI"]); ?>" /> 
    98           <input name="submit" type="submit" tabindex="5" value="<?php _e('Say It!' ); ?>" /> 
     98          <?php submit_button( __( 'Say It!' ), '', 'submit', false, array( 'tabindex' => '5' ) ); ?> 
    9999        </p> 
    100100        <?php do_action('comment_form', $post->ID); ?> 
    101101</form> 
  • wp-includes/theme-compat/comments.php

     
    8989 
    9090<p><textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea></p> 
    9191 
    92 <p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Submit Comment'); ?>" /> 
     92<p><?php submit_button( __( 'Submit Comment' ), '', 'submit', false, array( 'tabindex' => '5' ) ); ?> 
    9393<?php comment_id_fields(); ?> 
    9494</p> 
    9595<?php do_action('comment_form', $post->ID); ?> 
  • wp-login.php

     
    433433        </p> 
    434434<?php do_action('lostpassword_form'); ?> 
    435435        <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" /> 
    436         <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Get New Password'); ?>" tabindex="100" /></p> 
     436        <?php submit_button( __( 'Get New Password' ), 'primary', 'wp-submit', true, array( 'tabindex' => '100' ) ); ?> 
    437437</form> 
    438438 
    439439<p id="nav"> 
     
    488488        <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ &amp; ).'); ?></p> 
    489489 
    490490        <br class="clear" /> 
    491         <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Reset Password'); ?>" tabindex="100" /></p> 
     491        <?php submit_button( __( 'Reset Password' ), 'primary', 'wp-submit', true, array( 'tabindex' => '100' ) ); ?> 
    492492</form> 
    493493 
    494494<p id="nav"> 
     
    546546        <p id="reg_passmail"><?php _e('A password will be e-mailed to you.') ?></p> 
    547547        <br class="clear" /> 
    548548        <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" /> 
    549         <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Register'); ?>" tabindex="100" /></p> 
     549        <?php submit_button( __( 'Register' ), 'primary', 'wp-submit', true, array( 'tabindex' => '100' ) ); ?> 
    550550</form> 
    551551 
    552552<p id="nav"> 
     
    663663<?php do_action('login_form'); ?> 
    664664        <p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90"<?php checked( $rememberme ); ?> /> <?php esc_attr_e('Remember Me'); ?></label></p> 
    665665        <p class="submit"> 
    666                 <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Log In'); ?>" tabindex="100" /> 
     666                <?php submit_button( __( 'Log In' ), 'primary', 'wp-submit', false, array( 'tabindex' => '100' ) ); ?> 
    667667<?php   if ( $interim_login ) { ?> 
    668668                <input type="hidden" name="interim-login" value="1" /> 
    669669<?php   } else { ?> 
  • wp-signup.php

     
    192192                <input type="hidden" name="stage" value="gimmeanotherblog" /> 
    193193                <?php do_action( "signup_hidden_fields" ); ?> 
    194194                <?php show_blog_form($blogname, $blog_title, $errors); ?> 
    195                 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site' ) ?>" /></p> 
     195                <?php submit_button( __( 'Create Site' ), 'submit', 'submit' ); ?> 
    196196        </form> 
    197197        <?php 
    198198} 
     
    271271                <?php } ?> 
    272272                </p> 
    273273 
    274                 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e('Next') ?>" /></p> 
     274                <?php submit_button( __( 'Next' ), 'submit', 'submit' ); ?> 
    275275        </form> 
    276276        <?php 
    277277} 
     
    327327                <input type="hidden" name="user_email" value="<?php echo esc_attr($user_email) ?>" /> 
    328328                <?php do_action( "signup_hidden_fields" ); ?> 
    329329                <?php show_blog_form($blogname, $blog_title, $errors); ?> 
    330                 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e('Signup') ?>" /></p> 
     330                <?php submit_button( __( 'Signup' ), 'submit', 'submit', true ); ?> 
    331331        </form> 
    332332        <?php 
    333333}