When updating the name a hierarchical term with Quick Edit, update the corresponding option in the Parent dropdown.

Props garyc40, rmarks.
Fixes #14565.

git-svn-id: https://develop.svn.wordpress.org/trunk@31288 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2015-01-29 01:52:47 +00:00
parent 2e848072eb
commit fb447fb687
1 changed files with 13 additions and 2 deletions

View File

@ -89,7 +89,7 @@ inlineEditTax = {
// make ajax request
$.post( ajaxurl, params,
function(r) {
var row, new_id;
var row, new_id, option_value;
$('table.widefat .spinner').hide();
if (r) {
@ -98,7 +98,18 @@ inlineEditTax = {
new_id = $(r).attr('id');
$('#edit-'+id).before(r).remove();
row = new_id ? $('#'+new_id) : $(inlineEditTax.what+id);
if ( new_id ) {
option_value = new_id.replace( inlineEditTax.type + '-', '' );
row = $( '#' + new_id );
} else {
option_value = id;
row = $( inlineEditTax.what + id );
}
// Update the value in the Parent dropdown.
$( '#parent' ).find( 'option[value=' + option_value + ']' ).text( row.find( '.row-title' ).text() );
row.hide().fadeIn();
} else {
$('#edit-'+id+' .inline-edit-save .error').html(r).show();