Make WordPress Core

Ticket #15064: 15064.dupe-ids.diff

File 15064.dupe-ids.diff, 1.2 KB (added by duck_, 13 years ago)
  • wp-admin/includes/template.php

     
    21202120        endswitch;
    21212121        $text = ( NULL == $text ) ? __( 'Save Changes' ) : $text;
    21222122
     2123        // Default the id attribute to $name unless an id was specifically provided in $other_attributes
     2124        $id = $name;
     2125        if ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) ) {
     2126                $id = $other_attributes['id'];
     2127                unset( $other_attributes['id'] );
     2128        }
     2129
    21232130        $attributes = '';
    21242131        if ( is_array( $other_attributes ) ) {
    21252132                foreach ( $other_attributes as $attribute => $value ) {
     
    21292136                $attributes = $other_attributes;
    21302137        }
    21312138
    2132         // Default the id attribute to $name unless an id was specifically provided in $other_attributes
    2133         $id = $name;
    2134         if ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) )
    2135                 $id = $other_attributes['id'];
    2136 
    21372139        $button = '<input type="submit" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" class="' . esc_attr( $class );
    21382140        $button .= '" value="' . esc_attr( $text ) . '" ' . $attributes . ' />';
    21392141