WordPress.org

Make WordPress Core

Changeset 16568


Ignore:
Timestamp:
11/24/2010 04:30:40 PM (10 years ago)
Author:
markjaquith
Message:

Do not double up on id attribute for submit_button() if id is provided in other attributes param. props duck_. see #15064

File:
1 edited

Legend:

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

    r16509 r16568  
    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 ) ) {
     
    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 . ' />';
Note: See TracChangeset for help on using the changeset viewer.