From 02e9501c47a772282ddad1cc68bc6e6a5994b272 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Wed, 24 Nov 2010 16:30:40 +0000 Subject: [PATCH] Do not double up on id attribute for submit_button() if id is provided in other attributes param. props duck_. see #15064 git-svn-id: http://svn.automattic.com/wordpress/trunk@16568 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 5110ac2b18..37a1b8d830 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 = '';