diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index afe881a9a7..8019118ecf 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -2086,3 +2086,41 @@ function set_current_screen( $id = '' ) { $current_screen = apply_filters('current_screen', $current_screen); } +/** + * Echos a paragraph-wrapped submit button, with provided text and appropriate class + * + * @since 3.1.0 + * + * @param string $text The text of the button (defaults to 'Save Changes') + * @param string $type The type of button. One of: primary, secondary, delete + * @param string $name The HTML name of the submit button. Defaults to "submit" + */ +function submit_button( $text = NULL, $type = 'primary', $name = 'submit' ) { + echo get_submit_button( $text, $type, $name ); +} + +/** + * Returns a paragraph-wrapped submit button, with provided text and appropriate class + * + * @since 3.1.0 + * + * @param string $text The text of the button (defaults to 'Save Changes') + * @param string $type The type of button. One of: primary, secondary, delete + * @param string $name The HTML name of the submit button. Defaults to "submit" + */ +function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit' ) { + switch ( $type ) : + case 'primary' : + case 'secondary' : + $class = 'button-' . $type; + break; + case 'delete' : + $class = 'button-secondary delete'; + break; + default : + $class = $type; // Custom cases can just pass in the classes they want to be used + endswitch; + $text = ( NULL == $text ) ? __( 'Save Changes' ) : $text; + return '

'; +} + diff --git a/wp-admin/options-discussion.php b/wp-admin/options-discussion.php index a0a38703a4..aed3ad4e69 100644 --- a/wp-admin/options-discussion.php +++ b/wp-admin/options-discussion.php @@ -240,9 +240,7 @@ echo apply_filters('default_avatar_select', $avatar_list); -

- -

+ diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index ca4c70af38..edd6ed32e8 100644 --- a/wp-admin/options-general.php +++ b/wp-admin/options-general.php @@ -347,9 +347,7 @@ endfor; -

- -

+ diff --git a/wp-admin/options-media.php b/wp-admin/options-media.php index 2e5d10d045..f0576c28be 100644 --- a/wp-admin/options-media.php +++ b/wp-admin/options-media.php @@ -132,9 +132,7 @@ include('./admin-header.php'); -

- -

+ diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index 436d022763..b0845c31e9 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -221,9 +221,7 @@ $structures = array( -

- -

+ -

- -

+ diff --git a/wp-admin/options-reading.php b/wp-admin/options-reading.php index 7cd4c463c7..aeb01d1233 100644 --- a/wp-admin/options-reading.php +++ b/wp-admin/options-reading.php @@ -94,9 +94,7 @@ include( './admin-header.php' ); -

- -

+ diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php index dc06459d3d..0d3dd740c0 100644 --- a/wp-admin/options-writing.php +++ b/wp-admin/options-writing.php @@ -148,9 +148,7 @@ wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_email_categor -

- -

+