wp_insert_post don’t show event in calendar
-
Hi, I'm trying to create event programmatically with <code>wp_insert_post</code>. While the event is correctly insert in database, and listed in my back, it doesn't show in the calendar ! I also tried <code>tribe_create_event</code>, same thing. Did I missing something ? I have to publish manually from the back to get my events displayed.
A part of my code :
$my_post = array( 'ID' => $ID, // 'post_type' => TribeEvents::POSTTYPE, 'post_type' => "tribe_events", 'post_title' => wp_strip_all_tags($_POST['input_2']), 'post_content' => $_POST['input_21'], // 'post_status' => $_POST['input_43'], 'post_status' => "publish", 'post_author' => get_current_user_id(), 'meta_input' => array( //Default to work well '_EventShowMapLink' => true, '_EventShowMap' => true, //others '_EventStartDate' => $_POST['input_11'] . " " . implode(":", $_POST['input_12']) . ":00", '_EventEndDate' => $_POST['input_13'] . " " . implode(":", $_POST['input_14']) . ":00", '_EventURL' => $_POST['input_28'], '_EventCost' => $_POST['input_27'], '_tribe_events_virtual_url' => $_POST['input_30'] ), 'tax_input' => array( 'tribe_events_cat' => array($_POST['input_8']) ) ); // $event_id = wp_insert_post($my_post); $event_id = tribe_create_event($my_post);
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘wp_insert_post don’t show event in calendar’ is closed to new replies.