WordPress.org

Make WordPress Core

Ticket #12132: 12132.patch

File 12132.patch, 1.2 KB (added by johnbillion, 8 years ago)

Adds an 'id' parameter to wp_dropdown_users()

  • wp-includes/user.php

     
    506506 * <li>echo - Default is '1'. Whether to display or retrieve content.</li>
    507507 * <li>selected - Which User ID is selected.</li>
    508508 * <li>name - Default is 'user'. Name attribute of select element.</li>
     509 * <li>id - Default is the value of the 'name' parameter. ID attribute of select element.</li>
    509510 * <li>class - Class attribute of select element.</li>
    510511 * </ol>
    511512 *
     
    522523                'orderby' => 'display_name', 'order' => 'ASC',
    523524                'include' => '', 'exclude' => '', 'multi' => 0,
    524525                'show' => 'display_name', 'echo' => 1,
    525                 'selected' => 0, 'name' => 'user', 'class' => ''
     526                'selected' => 0, 'name' => 'user', 'id' => '',
     527                'class' => ''
    526528        );
    527529
    528530        $defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0;
     
    555557
    556558        $output = '';
    557559        if ( !empty($users) ) {
    558                 $id = $multi ? "" : "id='$name'";
     560                if ( $multi ) {
     561                        $id = '';
     562                } else {
     563                        $id = $id ? "id='$id'" : "id='$name'";
     564                }
    559565
    560566                $output = "<select name='$name' $id class='$class'>\n";
    561567