The wordpress function is used to transfer data programmatically. Standard fields for applying for content, excerpt, title, date and more.
Why there is no documentation, how to send to a custom field. I know that this is possible with a function add_post_meta($post_id, $meta_key, $meta_value, $unique);.
I do not know how to include this in the standard wp_insert_post function. So I ask you all because this is more of a PHP question than a WP question. Below is the PHP code to send the message.
<?php
$my_post = array(
'post_title' => $_SESSION['booking-form-title'],
'post_date' => $_SESSION['cal_startdate'],
'post_content' => 'This is my post.',
'post_status' => 'publish',
'post_type' => 'booking',
);
wp_insert_post( $my_post );
?>
Any helpers
Wonderful
source
share