Do not output empty name and id HTML attributes in get_submit_button().

Props afercia. Fixes #31749.
Built from https://develop.svn.wordpress.org/trunk@31880


git-svn-id: http://core.svn.wordpress.org/trunk@31859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-03-25 03:23:27 +00:00
parent 2c45fd7ed7
commit f5e6f92174
2 changed files with 6 additions and 2 deletions

View File

@ -1908,7 +1908,11 @@ function get_submit_button( $text = '', $type = 'primary large', $name = 'submit
$attributes = $other_attributes;
}
$button = '<input type="submit" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" class="' . esc_attr( $class );
// Don't output empty name and id attributes.
$name_attr = $name ? ' name="' . esc_attr( $name ) . '"' : '';
$id_attr = $id ? ' id="' . esc_attr( $id ) . '"' : '';
$button = '<input type="submit"' . $name_attr . $id_attr . ' class="' . esc_attr( $class );
$button .= '" value="' . esc_attr( $text ) . '" ' . $attributes . ' />';
if ( $wrap ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-beta2-31879';
$wp_version = '4.2-beta2-31880';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.