Other Documentations
How to add additional event data to JSON output
August 24, 2016
API addon is built so that you can add additional event post meta data to the JSON array. In the below example we are going to add subtitle for an event into the JSON data output.
Paste this code into your main theme’s functions.php file
1 2 3 4 5 6 7 |
add_filter('evoapi_event_data', 'evoapi_add_moredata', 10, 3); function evoapi_add_moredata($event_data, $event_id, $event_pmv){ if(!empty($event_pmv['evcal_subtitle'])){ $event_data['subtitle'] = $event_pmv['evcal_subtitle'][0]; } return $event_data; } |
You can find all event post meta variable names in hereĀ http://www.myeventon.com/documentation/event-post-meta-variables/
Output JSON stream will include the subtitle field as you can see below.
Did this article help you? If not, send us a ticket via helpdesk