Fix nested HTML in submit_button(). fixes #15257, see #15064.

git-svn-id: https://develop.svn.wordpress.org/trunk@16097 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-10-30 06:14:15 +00:00
parent 68d5bd05df
commit 0180091a56
1 changed files with 4 additions and 5 deletions

View File

@ -2149,12 +2149,11 @@ function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit', $
}
// Default the id attribute to $name unless an id was specifically provided in $other_attributes
$id = 'id="' . esc_attr( $name ) . '" ';
if ( is_array( $other_attributes ) && array_key_exists( 'id', $other_attributes ) ) {
$id = 'id="' . esc_attr( $other_attributes['id'] ) . '" ';
}
$id = $name;
if ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) )
$id = $other_attributes['id'];
$button = '<input type="submit" name="' . esc_attr( $name ) . '" id="' . $id . '" class="' . esc_attr( $class );
$button = '<input type="submit" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" class="' . esc_attr( $class );
$button .= '" value="' . esc_attr( $text ) . '" ' . $attributes . ' />';
if ( $wrap ) {