WordPress.org

Make WordPress Core

Changeset 37913


Ignore:
Timestamp:
06/29/2016 02:06:01 PM (4 years ago)
Author:
ocean90
Message:

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

Props Offereins.
Fixes #35010.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r37779 r37913  
    16901690
    16911691    $level = 0;
    1692     $request_post = array( get_post( $_POST['post_ID'] ) );
    1693     $parent = $request_post[0]->post_parent;
    1694 
    1695     while ( $parent > 0 ) {
    1696         $parent_post = get_post( $parent );
    1697         $parent = $parent_post->post_parent;
    1698         $level++;
     1692    if ( is_post_type_hierarchical( $wp_list_table->screen->post_type ) ) {
     1693        $request_post = array( get_post( $_POST['post_ID'] ) );
     1694        $parent       = $request_post[0]->post_parent;
     1695
     1696        while ( $parent > 0 ) {
     1697            $parent_post = get_post( $parent );
     1698            $parent      = $parent_post->post_parent;
     1699            $level++;
     1700        }
    16991701    }
    17001702
Note: See TracChangeset for help on using the changeset viewer.