diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 5110ac2b1..37a1b8d83 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -2120,6 +2120,13 @@ function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit', $ endswitch; $text = ( NULL == $text ) ? __( 'Save Changes' ) : $text; + // Default the id attribute to $name unless an id was specifically provided in $other_attributes + $id = $name; + if ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) ) { + $id = $other_attributes['id']; + unset( $other_attributes['id'] ); + } + $attributes = ''; if ( is_array( $other_attributes ) ) { foreach ( $other_attributes as $attribute => $value ) { @@ -2129,11 +2136,6 @@ function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit', $ $attributes = $other_attributes; } - // Default the id attribute to $name unless an id was specifically provided in $other_attributes - $id = $name; - if ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) ) - $id = $other_attributes['id']; - $button = '';