From 5268552d722c29bdcee6783a1bc726a926f195bc Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Sat, 30 Jun 2012 09:00:26 +0000 Subject: [PATCH] Prevent child categories from being visually promoted to the top level after Quick Edit. props ssamture. fixes #19474 git-svn-id: https://develop.svn.wordpress.org/trunk@21191 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/ajax-actions.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 5ced90166f..e47fb11fb3 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -1404,14 +1404,19 @@ function wp_ajax_inline_save_tax() { wp_die( $tag->get_error_message() ); wp_die( __( 'Item not updated.' ) ); } - - echo $wp_list_table->single_row( $tag ); } else { if ( is_wp_error($updated) && $updated->get_error_message() ) wp_die( $updated->get_error_message() ); wp_die( __( 'Item not updated.' ) ); } - + $level = 0; + $parent = $tag->parent; + while ( $parent > 0 ) { + $parent_tag = get_term( $parent, $taxonomy ); + $parent = $parent_tag->parent; + $level++; + } + echo $wp_list_table->single_row( $tag, $level ); wp_die(); }