ACF Utwórz post z polami

// CREATE NEW POST + CREATE ACF FIELDS
$new_post = array(
'post_title' => $message,
'post_content' => $content,
'post_status' => 'publish',
'post_type' => 'post', // page or your custom post type
);
$post_id = wp_insert_post($new_post);

// CREATE FIELDS ACF inside on the created post
update_field("type", $acf_type, $post_id); // params: field, value, postId
update_field("sendMail", "yes", $post_id);
gtamborero