Posts: In `wp_ajax_inline_save()`, do not apply level for non-hierarchical post types.

Props Offereins.
Fixes #35010.
Built from https://develop.svn.wordpress.org/trunk@37913


git-svn-id: http://core.svn.wordpress.org/trunk@37854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-06-29 14:07:31 +00:00
parent 809ad6e429
commit 0b7b8981aa
2 changed files with 9 additions and 7 deletions

View File

@ -1689,13 +1689,15 @@ function wp_ajax_inline_save() {
$mode = $_POST['post_view'] === 'excerpt' ? 'excerpt' : 'list';
$level = 0;
$request_post = array( get_post( $_POST['post_ID'] ) );
$parent = $request_post[0]->post_parent;
if ( is_post_type_hierarchical( $wp_list_table->screen->post_type ) ) {
$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++;
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 );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37912';
$wp_version = '4.6-alpha-37913';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.