From fc6e89da450bf73593e09ae9cd3849d6ec76a9a2 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Thu, 28 Oct 2010 21:56:43 +0000 Subject: [PATCH] Expand submit_button() capabilities. Replace all (or almost all) manual HTML instances in WP. props sbressler. see #15064 git-svn-id: http://svn.automattic.com/wordpress/trunk@16061 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/comment.php | 2 +- wp-admin/custom-background.php | 6 +- wp-admin/custom-header.php | 10 +-- wp-admin/edit-comments.php | 2 +- wp-admin/edit-form-comment.php | 2 +- wp-admin/edit-tags.php | 8 +-- wp-admin/edit.php | 2 +- wp-admin/export.php | 2 +- wp-admin/includes/class-wp-list-table.php | 3 +- wp-admin/includes/dashboard.php | 2 +- wp-admin/includes/file.php | 4 +- wp-admin/includes/list-table-comments.php | 8 +-- wp-admin/includes/list-table-links.php | 2 +- wp-admin/includes/list-table-media.php | 14 ++-- wp-admin/includes/list-table-plugins.php | 2 +- wp-admin/includes/list-table-posts.php | 12 ++-- wp-admin/includes/list-table-users.php | 2 +- wp-admin/includes/media.php | 22 ++++--- wp-admin/includes/meta-boxes.php | 10 +-- wp-admin/includes/nav-menu.php | 6 +- wp-admin/includes/plugin-install.php | 2 +- wp-admin/includes/template.php | 71 ++++++++++++++++----- wp-admin/includes/theme-install.php | 7 +- wp-admin/includes/widgets.php | 2 +- wp-admin/install.php | 2 +- wp-admin/link-manager.php | 2 +- wp-admin/media-upload.php | 4 +- wp-admin/media.php | 4 +- wp-admin/ms-delete-site.php | 2 +- wp-admin/my-sites.php | 4 +- wp-admin/nav-menus.php | 6 +- wp-admin/network.php | 4 +- wp-admin/network/edit.php | 2 +- wp-admin/network/sites.php | 2 +- wp-admin/network/themes.php | 8 +-- wp-admin/network/users.php | 2 +- wp-admin/options.php | 2 +- wp-admin/plugin-editor.php | 12 ++-- wp-admin/plugins.php | 6 +- wp-admin/press-this.php | 14 ++-- wp-admin/setup-config.php | 2 +- wp-admin/theme-editor.php | 11 ++-- wp-admin/themes.php | 4 +- wp-admin/update-core.php | 8 +-- wp-admin/upload.php | 2 +- wp-admin/user-new.php | 5 +- wp-admin/users.php | 2 +- wp-admin/widgets.php | 12 ++-- wp-includes/comment-template.php | 2 +- wp-includes/general-template.php | 4 +- wp-includes/post-template.php | 8 ++- wp-includes/post.php | 4 +- wp-includes/theme-compat/comments-popup.php | 2 +- wp-includes/theme-compat/comments.php | 2 +- wp-login.php | 8 +-- wp-signup.php | 6 +- 56 files changed, 197 insertions(+), 164 deletions(-) diff --git a/wp-admin/comment.php b/wp-admin/comment.php index f5d662966..30953f1d3 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -180,7 +180,7 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved - +
diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php index ba9391ca5..6d974feff 100644 --- a/wp-admin/custom-background.php +++ b/wp-admin/custom-background.php @@ -210,7 +210,7 @@ if ( get_background_image() ) {
-
+
@@ -223,7 +223,7 @@ if ( get_background_image() ) {
-
+
@@ -236,7 +236,7 @@ if ( get_background_image() ) {
- +

diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index c085d6fc4..f1567f09d 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -468,7 +468,7 @@ class Custom_Image_Header { - +

@@ -501,7 +501,7 @@ class Custom_Image_Header {

- +

- + @@ -550,7 +550,7 @@ class Custom_Image_Header {

- + @@ -563,7 +563,7 @@ do_action( 'custom_header_options' ); wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> - + diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index fee37b57d..a7ed3c7ce 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -202,7 +202,7 @@ if ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQU diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index 42f3e9d84..c299e5216 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -71,7 +71,7 @@ $date = date_i18n( $datef, strtotime( $comment->comment_date ) ); comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "\n"; ?>
- + '4' ) ); ?>
diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 6649a3fc9..37b169a4b 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -225,7 +225,7 @@ endif; ?>
@@ -334,9 +334,9 @@ if ( current_user_can($tax->cap->edit_terms) ) { if ( ! is_taxonomy_hierarchical($taxonomy) ) do_action('add_tag_form_fields', $taxonomy); do_action($taxonomy . '_add_form_fields', $taxonomy); -?> -

-labels->add_new_item ); + // Back compat hooks. Deprecated in preference to {$taxonomy}_add_form if ( 'category' == $taxonomy ) do_action('edit_category_form', (object)array('parent' => 0) ); diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 659bdafcd..3645ccf54 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -223,7 +223,7 @@ $_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated' diff --git a/wp-admin/export.php b/wp-admin/export.php index 492b4394f..402d4b18b 100644 --- a/wp-admin/export.php +++ b/wp-admin/export.php @@ -53,7 +53,7 @@ if ( $monthyears = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`

- +

diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index 90ca60cdc..90cbfc72c 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -253,7 +253,8 @@ class WP_List_Table { echo "\t\n"; echo "\n"; - echo "\n"; + submit_button( __( 'Apply' ), 'button-secondary action', "doaction$two", false ); + echo "\n"; } /** diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 860c8ae50..035b3fe86 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -479,7 +479,7 @@ function wp_dashboard_quick_press_output() { - + 'save-post', 'tabindex'=> 4 ) ); ?> diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 2d3b282e2..6fa2310d8 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -1066,10 +1066,8 @@ foreach ( (array) $extra_fields as $field ) { if ( isset( $_POST[ $field ] ) ) echo ''; } +submit_button( __( 'Proceed' ), 'button', 'upgrade' ); ?> -

- -

$label\n"; ?> - - - -'; } diff --git a/wp-admin/includes/list-table-links.php b/wp-admin/includes/list-table-links.php index 635a6c61e..c9004fc3f 100644 --- a/wp-admin/includes/list-table-links.php +++ b/wp-admin/includes/list-table-links.php @@ -69,8 +69,8 @@ class WP_Links_Table extends WP_List_Table { 'orderby' => 'name', ); wp_dropdown_categories( $dropdown_options ); + submit_button( __( 'Filter' ), 'secondary', 'post-query-submit', false ); ?> - months_dropdown( $post_type ); do_action( 'restrict_manage_posts' ); -?> - - - - is_trash && current_user_can( $post_type_obj->cap->edit_others_posts ) ) { ?> - - + if ( $detached ) { + submit_button( __( 'Scan for lost attachments' ), 'secondary', 'find_detached', false ); + } elseif ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) { + submit_button( __( 'Empty Trash' ), 'button-secondary apply', 'delete_all', false ); + } ?>
- +
- is_trash && current_user_can( $post_type_object->cap->edit_others_posts ) ) { -?> - -" class="button-primary save alignright"> - - + submit_button( __( 'Update' ), 'button-primary alignright', 'bulk_edit', false, array( 'accesskey' => 's' ) ); + } ?>
diff --git a/wp-admin/includes/list-table-users.php b/wp-admin/includes/list-table-users.php index a3858c452..124cc1154 100644 --- a/wp-admin/includes/list-table-users.php +++ b/wp-admin/includes/list-table-users.php @@ -112,7 +112,7 @@ class WP_Users_Table extends WP_List_Table { - + "; + $send = get_submit_button( __( 'Insert into Post' ), 'button', "send[$attachment_id]", false ); if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) { if ( !EMPTY_TRASH_DAYS ) { $delete = "" . __( 'Delete Permanently' ) . ''; @@ -1459,8 +1459,10 @@ SWFUpload.onload = function() {

- - + + + +

@@ -1492,7 +1494,7 @@ function media_upload_type_form($type = 'file', $errors = null, $id = null) { ?>
- + @@ -1525,7 +1527,7 @@ if ( $id ) { ?>

- +

- + 'save-all', 'style' => 'display: none;' ) ); ?> @@ -1828,7 +1830,7 @@ function media_upload_library_form($errors) {