• I am trying to save a revision of a custom post type. This is what I have to check if the post has a parent:

    function save_revision( $post ) {
    
       if ( $post['submitted'] == true ) {
           $parent_id = wp_is_post_revision( $post['post_id'] );
           ...
       }
    } add_action('init', 'save_revision');

    The problem is that I always get false for $parent_id even though I know there is a parent post for that post_id.

    Any help is appreciated, I have been trying to get this to work forever.

Viewing 1 replies (of 1 total)
  • I have the same problem with a simple custom post type.

    Unrelated: I assume you are doing more with your temporary $parent_id that is not shown since what you have will of course not give you a parent_id. (Sorry if this is already obvious.)

    jeff

Viewing 1 replies (of 1 total)
  • The topic ‘Why is wp_is_post_revision always false?’ is closed to new replies.