Save post_parent in a custom post type
You could use the wp_insert_post_data filter instead, which gives you direct access to the post’s data. function wpa_insert_post( $data , $postarr ){ //do something with $data[‘post_parent’] return $data; } add_filter( ‘wp_insert_post_data’ , ‘wpa_insert_post’ , ’99’, 2 ); UPDATE: I added the following to your code and it’s working: function wpa_insert_post( $data , $postarr ){ //do … Read more