It’s been almost 3 months since I looked at this issue, I got it “working”, but there were issues so I dropped ACF and added the custom fields to the post type manually. If I remember correctly, the data was “there”, as in associated with the post and custom field, but the field was never populated in the UI.
I was actually too hasty on this and I can’t edit it anymore. The post object field is accepting the value of $postid
formatted as an int
, but it’s not displaying in the edit post screen, it’s just showing up as an empty field.
Further Elaboration of the code.
function custom_post_generator($posttitle,$parentpostID,$item,$postnum){
$post_info = array (
'post_type'=>'custom_post_type',
'post_title' => $posttitle,
'post_status' => 'publish',
'comment_status' => 'closed',
'ping_status' => 'closed',);
$postID = wp_insert_post($post_info);
//parent post, post object field
update_field('field_62a908d5690ce', $parentpostID, $postID);