wp_insert_post not show thru shortcode
-
Hello,
nice pluginIm trying to import events from facebook.
All is ok but one thing.
When am using shortcodes like – [events_list] nothing shows.But in the admin the events are there, the event current page is working, they are posted.
All is ok exept in the shortcodes.
If I save the event thru the admin it is show in the shortcode
—————————————————————
$postarr = array();
$postarr[‘post_author’] = 1;
$postarr[‘post_content’] = ‘test’;
$postarr[‘post_title’] = ‘test’;
$postarr[‘post_name’] = ‘test’;
$postarr[‘post_type’] = ‘event’;
$postarr[‘post_status’] = ‘publish’;
$postarr[‘post_date’] = date(‘Y-m-d H:i:s’);//inset the post
$currentPost = wp_insert_post($postarr);$meta_keys = array();
$meta_keys[‘_location_id’] = ‘1’;
$meta_keys[‘_event_timezone’] = ‘UTC’;
$meta_keys[‘_event_end_local’] = ‘2018-12-16 04:30:00’;
$meta_keys[‘_event_start_local’] = ‘2018-12-15 03:00:00’;
$meta_keys[‘_event_end_date’] = ‘2018-12-16’;
$meta_keys[‘_event_start_time’] = ’03:00:00′;
$meta_keys[‘_event_end_time’] = ’04:30:00′;
$meta_keys[‘_event_start’] = ‘2018-12-15 03:00:00’;
$meta_keys[‘_event_end’] = ‘2018-12-16 04:30:00’;
$meta_keys[‘_event_start_date’] = ‘2018-12-15’;//this is dynamic
$meta_keys[‘_event_id’] = 3 ;//adding the postmeta
foreach ($meta_keys as $key => $value) {
add_post_meta( $currentPost, $key, $value );
}
- The topic ‘wp_insert_post not show thru shortcode’ is closed to new replies.