Created
October 4, 2018 22:27
-
-
Save alexwcoleman/8d581ac12f028c5754c52021b30dc202 to your computer and use it in GitHub Desktop.
Adding Custom Endpoints to The Events Calendar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this filter adds the custom field values to the json output for The Events Calendar | |
// https://theeventscalendar.com/support/forums/topic/custom-field-output-for-json-feed/ | |
add_filter( 'tribe_rest_event_data', 'omfg_add_event_customfields' ); | |
function omfg_add_event_customfields($data) { | |
$event_id = $data['id']; | |
$some_data = 'some data'; | |
$data = array_merge( $data, | |
// This is for a single value | |
array('band_id' => $some_data, | |
)); | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment