Make WordPress Core

Changeset 20964


Ignore:
Timestamp:
05/30/2012 09:54:33 PM (12 years ago)
Author:
azaozz
Message:

Do not clear the old values in "Display name publicly as" drop-down on the user profile screen, append new values there when the user changes any of20747 the name fields, fixes #20747

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/user-profile.dev.js

    r20431 r20964  
    4242        if ( select.length ) {
    4343            $('#first_name, #last_name, #nickname').bind( 'blur.user_profile', function() {
    44                 var current = select.find('option:selected').attr('id'), dub = [],
     44                var dub = [],
    4545                    inputs = {
    4646                        display_nickname  : $('#nickname').val() || '',
     
    5555                }
    5656
    57                 $('option', select).remove();
     57                $.each( $('option', select), function( i, el ){
     58                    dub.push( el.value );
     59                });
     60
    5861                $.each(inputs, function( id, value ) {
    5962                    if ( ! value )
     
    6568                        dub.push(val);
    6669                        $('<option />', {
    67                             'id': id,
    68                             'text': val,
    69                             'selected': (id == current)
     70                            'text': val
    7071                        }).appendTo( select );
    7172                    }
  • trunk/wp-admin/user-edit.php

    r20196 r20964  
    320320            foreach ( $public_display as $id => $item ) {
    321321        ?>
    322             <option id="<?php echo $id; ?>"<?php selected( $profileuser->display_name, $item ); ?>><?php echo $item; ?></option>
     322            <option <?php selected( $profileuser->display_name, $item ); ?>><?php echo $item; ?></option>
    323323        <?php
    324324            }
Note: See TracChangeset for help on using the changeset viewer.