diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index e47fb11fb3..9daafed22e 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -1368,7 +1368,18 @@ function wp_ajax_inline_save() { $wp_list_table = _get_list_table('WP_Posts_List_Table'); $mode = $_POST['post_view']; - $wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ) ); + + $level = 0; + $request_post = array( get_post( $_POST['post_ID'] ) ); + $parent = $request_post[0]->post_parent; + + while ( $parent > 0 ) { + $parent_post = get_post( $parent ); + $parent = $parent_post->post_parent; + $level++; + } + + $wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ), $level ); wp_die(); } diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index 80e52cac9e..151fe36c65 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -300,7 +300,7 @@ class WP_Posts_List_Table extends WP_List_Table { ); } - function display_rows( $posts = array() ) { + function display_rows( $posts = array(), $level = 0 ) { global $wp_query, $post_type_object, $per_page; if ( empty( $posts ) ) @@ -311,11 +311,11 @@ class WP_Posts_List_Table extends WP_List_Table { if ( $this->hierarchical_display ) { $this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page ); } else { - $this->_display_rows( $posts ); + $this->_display_rows( $posts, $level ); } } - function _display_rows( $posts ) { + function _display_rows( $posts, $level = 0 ) { global $post, $mode; // Create array of post IDs. @@ -327,7 +327,7 @@ class WP_Posts_List_Table extends WP_List_Table { $this->comment_pending_count = get_pending_comments_num( $post_ids ); foreach ( $posts as $post ) - $this->single_row( $post ); + $this->single_row( $post, $level ); } function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) { @@ -524,8 +524,10 @@ class WP_Posts_List_Table extends WP_List_Table { } else { $attributes = 'class="post-title page-title column-title"' . $style; + + $pad = str_repeat( '— ', $level ); ?> -