Make WordPress Core

Changeset 31288


Ignore:
Timestamp:
01/29/2015 01:52:47 AM (10 years ago)
Author:
boonebgorges
Message:

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

Props garyc40, rmarks.
Fixes #14565.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/inline-edit-tax.js

    r31181 r31288  
    9090        $.post( ajaxurl, params,
    9191            function(r) {
    92                 var row, new_id;
     92                var row, new_id, option_value;
    9393                $('table.widefat .spinner').hide();
    9494
     
    9999
    100100                        $('#edit-'+id).before(r).remove();
    101                         row = new_id ? $('#'+new_id) : $(inlineEditTax.what+id);
     101
     102                        if ( new_id ) {
     103                            option_value = new_id.replace( inlineEditTax.type + '-', '' );
     104                            row = $( '#' + new_id );
     105                        } else {
     106                            option_value = id;
     107                            row = $( inlineEditTax.what + id );
     108                        }
     109
     110                        // Update the value in the Parent dropdown.
     111                        $( '#parent' ).find( 'option[value=' + option_value + ']' ).text( row.find( '.row-title' ).text() );
     112
    102113                        row.hide().fadeIn();
    103114                    } else {
Note: See TracChangeset for help on using the changeset viewer.