I have a code on which I insert post using my custom template, everything works aside from post_status field, am I missing something ?
$new_speakerevent = array(
'post_ID' => $page_id,
'post_title' => wp_strip_all_tags('HubName'. ' ' .$date. ' ' .'speakerName'),
'post_content' => '',
'post_status' => 'future',
'post_type' => 'speakers',
'post_author' => 12 //default account is 12
);
$idtoreturn = wp_insert_post( $new_speakerevent );
What happen is instead of future, the status is automatically changing to PUBLIC