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:
parent
2e848072eb
commit
fb447fb687
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user