

My problem is that I got it working with categories but since some time it’s not working anymore.
#Wp event manager code
This code works perfectly as the core code for the nightly script and imports events as necessary. The same filter is used by the plugin when saving other post types so one needs to be careful when using it. The code uses ‘ em_event_save‘ filter – it changes the slug, author (from the anonymous one that would leave the event status as ‘Pending’) and the status to ‘Publish.’ Removing the filter is not necessary in this script but included for completeness. This was useful on the Cork Entertainment site because bands play more than once and slugs with numerical suffixes e.g. The script below, a standalone one, goes a step further – after the event is created it changes the default slug, which is based on the event name, to one based on a concatenation of the event name and date. The date and time formats are simple: yyyy-mm-dd and hh:mm:ss. Only 4 items of information to create an event – name, post content, start date and start time. The client site uses the Events Manager plugin so it needs to create events dynamically.Įvents Manager uses the event title and content to create a post of type ‘ event.’ It then stores the event details (date, time, location etc) as post meta. On Cork Entertainment, a client site that lists events in Cork in Ireland, I run a script each night to scrape data from the website of one venue (with the venue owner’s permission).

This is the core of the code I use in a nightly event import script on a client site.

You only need 4 pieces of information to create an Events Manager event in PHP.
