From 9855eccd4539b7d5fc1b8839715037c88f1b810d Mon Sep 17 00:00:00 2001 From: azaozz Date: Wed, 30 May 2012 21:54:33 +0000 Subject: [PATCH] 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 git-svn-id: http://core.svn.wordpress.org/trunk@20964 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/user-profile.dev.js | 11 ++++++----- wp-admin/user-edit.php | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/wp-admin/js/user-profile.dev.js b/wp-admin/js/user-profile.dev.js index 9897f070e..bd4885525 100644 --- a/wp-admin/js/user-profile.dev.js +++ b/wp-admin/js/user-profile.dev.js @@ -41,7 +41,7 @@ if ( select.length ) { $('#first_name, #last_name, #nickname').bind( 'blur.user_profile', function() { - var current = select.find('option:selected').attr('id'), dub = [], + var dub = [], inputs = { display_nickname : $('#nickname').val() || '', display_username : $('#user_login').val() || '', @@ -54,7 +54,10 @@ inputs['display_lastfirst'] = inputs.display_lastname + ' ' + inputs.display_firstname; } - $('option', select).remove(); + $.each( $('option', select), function( i, el ){ + dub.push( el.value ); + }); + $.each(inputs, function( id, value ) { if ( ! value ) return; @@ -64,9 +67,7 @@ if ( inputs[id].length && $.inArray( val, dub ) == -1 ) { dub.push(val); $(' +