Last active
December 11, 2015 23:39
-
-
Save PaulHughes01/4678437 to your computer and use it in GitHub Desktop.
Workaround to pass a given currency to Eventbrite when using Modern Tribe's The Events Calendar: Eventbrite Tickets plugin.
This file contains hidden or 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
| <?php | |
| /* PLACE THE FOLLOWING IN YOUR THEME'S FUNCTIONS.PHP FILE. */ | |
| add_action( 'tribe_eb_after_event_creation', 'my_change_tribe_eventbrite_currency', 10, 4 ); | |
| function my_change_tribe_eventbrite_currency( $eventbrite_id, $venue_id, $organizer_id, $post_id ) { | |
| // See http://www.currencysystem.com/codes/ for a list of three-letter | |
| // currency acronyms. Change the below variable to your preference. | |
| $currency_acro = 'EUR'; | |
| $parameters = 'id=' . $eventbrite_id . '¤cy=' . $currency_acro; | |
| $success = Event_Tickets_PRO::sendEventBriteRequest( 'event_update', $parameters, $post_id, true, true, false ); | |
| if ( !$success ) { | |
| add_filter( 'tribe_eb_error_message', 'my_change_tribe_eventbrite_currency_failed' ); | |
| } | |
| } | |
| function my_change_tribe_eventbrite_currency_failed() { | |
| return 'Failed to update the currency.'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment