I followed the instruction on how to set up posting from front end.
It’s working except my site’s posts doesn’t really have titles and gets the title from the custom fields I set up in acf.
Here’s my wp_insert_post code
function my_pre_save_post( $post_id )
// check if this is to be a new post
if( $post_id != 'new' )
// Create a new post
$post = array(
'post_status' => 'publish' ,
'post_title' => get_post_meta($post->ID, "pickup_date", true). ' - ' .get_post_meta($post->ID, "leaving_from", true). ' to ' .get_post_meta($post->ID, "going_to", true),
'post_type' => 'rides' ,
// insert the post
$post_id = wp_insert_post( $post );
// return the new ID
add_filter('acf/pre_save_post' , 'my_pre_save_post' );