метафайлы ACF сохраняются в базе данных как базовое настраиваемое поле .Так что вы можете использовать, например, функцию add_post_meta () со значениями add_post_meta ($ post_id, 'field_name', $ field_value);после wp_insert_post ($ post);функция.
пример кода:
$post = array(
'post_title' => $description,
'post_content' => $description,
'post_category' => 3, // Usable for custom taxonomies too
'post_status' => 'private', // Choose: publish, preview, future, etc.
'post_type' => 'door', // Use a custom post type if you want to
'post_parent' => $post->ID,
'post_name' => 'service',
'meta_key' => 'archive_job',
'meta_value' => 'red',
);
wp_set_object_terms($pid, $_POST['terms'], 'child');
$post_id = wp_insert_post($post); // Pass the value of $post to WordPress the insert function
add_post_meta($post_id, 'field_name', $field_value);
global $wp;
$current_url = home_url(add_query_arg(array(),$wp->request));
wp_redirect( $current_url );