From ba848978ac97f7e06b72a8f725b5c1c1c1d984d9 Mon Sep 17 00:00:00 2001 From: Andrew Ozz 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: https://develop.svn.wordpress.org/trunk@20964 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 9897f070e0..bd48855250 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); $(' +