How do I use em_get_events() to get list for one venue
-
Using Events Manager 5.6.6.1 on WordPress 4.6.1.
I am trying to import events from another site. I can wp_remote_get that page and parse it.
Now I want to get the events for a specific location and see if I need to add new events.
I would like a PHP array so that I can easily loop through each event for comparison.$args = array('location'=>586, 'format'=>'', 'format_header'=>'', 'format_footer'=>''); $venue_events = em_get_events( $args, true ); var_dump( $venue_events );
The venue id is from the url when I edit that venue.
Currently returning “No Events” but the venue does have an event on December 7:
https://www.corkentertainment.ie/venues/reardens-bar/I tried adding ‘array’=>1 to $args but that gives a fatal error:
PHP Fatal error: Call to a member function output() on a non-object in //wp-content/plugins/events-manager/classes/em-events.php on line 195I’ve read em-events.php but I cannot see how it should work. I don’t see where the database query is being done.
- The topic ‘How do I use em_get_events() to get list for one venue’ is closed to new replies.