WordPress.org

Make WordPress Core

Changeset 31880


Ignore:
Timestamp:
03/25/2015 03:22:18 AM (6 years ago)
Author:
azaozz
Message:

Do not output empty name and id HTML attributes in get_submit_button().
Props afercia. Fixes #31749.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r31765 r31880  
    19091909    }
    19101910
    1911     $button = '<input type="submit" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" class="' . esc_attr( $class );
     1911    // Don't output empty name and id attributes.
     1912    $name_attr = $name ? ' name="' . esc_attr( $name ) . '"' : '';
     1913    $id_attr = $id ? ' id="' . esc_attr( $id ) . '"' : '';
     1914
     1915    $button = '<input type="submit"' . $name_attr . $id_attr . ' class="' . esc_attr( $class );
    19121916    $button .= '" value="' . esc_attr( $text ) . '" ' . $attributes . ' />';
    19131917
Note: See TracChangeset for help on using the changeset viewer.