Support

Account

Home Forums General Issues Update_field() not working for post_object fields. Reply To: Update_field() not working for post_object fields.

  • 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);