WordPress.org

Make WordPress Core

Ticket #15914: 15914.diff

File 15914.diff, 654 bytes (added by nacin, 5 years ago)

Cheap fix for 3.1: Don't fire the filter for revisions. Untested.

  • wp-includes/post.php

     
    25102510                $post_parent = 0; 
    25112511 
    25122512        // Check the post_parent to see if it will cause a hierarchy loop 
    2513         $post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, compact( array_keys( $postarr ) ), $postarr ); 
     2513        if ( 'revision' != $post->post_type ) 
     2514                $post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, compact( array_keys( $postarr ) ), $postarr ); 
    25142515 
    25152516        if ( isset($menu_order) ) 
    25162517                $menu_order = (int) $menu_order;