Home › Forums › Ticket Products › Eventbrite Tickets › Additional Editing in WP of Eventbrite Event (Part 3)
- This topic has 7 replies, 2 voices, and was last updated 6 years, 9 months ago by Brandon.
-
AuthorPosts
-
June 6, 2017 at 10:42 am #1293898BrandonParticipant
This is a continuation of this support ticket and this follow-up support ticket, both of which are now closed to new replies. Please read through those support tickets for context on this issue.
I need the ability to import Eventbrite events then do additional edits within WP without updating back to Eventbrite. The previous fix (suggested in the follow-up support ticket linked above) was working for me until recently. I would do an import from Eventbrite, then I could make any changes I wanted to make to the description within WP; save; and Eventbrite was not updated (which is what I want).
This is the code that is in my custom functions which was working at one point…
/* This function disables syncing from Events Calendar PRO to Eventbrite. */ function citylife_inhibit_communication_with_eventbrite() { // Do nothing if Eventbrite Tickets is not activated if ( ! class_exists( 'Tribe__Events__Tickets__Eventbrite__Main' ) ) return; // Remove update callback $callback = array( Tribe__Events__Tickets__Eventbrite__Main::instance(), 'action_sync_event' ); remove_action( 'tribe_events_update_meta', $callback, 20 ); } add_action( 'wp_loaded', 'citylife_inhibit_communication_with_eventbrite', 100 );
I just did an import from Eventbrite; updated the description within WP; saved; the new description was saved to my Eventbrite event (which I DO NOT want). I’m not sure when this code snippet stopped working for me.
I am currently running:
The Events Calendar v4.5.3
The Events Calendar PRO v4.4.9
The Events Calendar: Eventbrite Tickets v4.4.4
WordPress 4.7.5June 8, 2017 at 9:53 pm #1295607CliffMemberHi, Brandon.
I’m guessing this is due to our changing to using the tribe() and tribe_singleton() functions.
Therefore, please replace
Tribe__Events__Tickets__Eventbrite__Main::instance()
withtribe( 'eventbrite.main' )
and see if that works.Please let me know how this goes for you.
June 28, 2017 at 1:04 pm #1310583BrandonParticipantSorry for the delay in my response. Unfortunately, this is still not working for me.
I made the change as suggested which resulted in this code…
/* This function disables syncing from Events Calendar PRO to Eventbrite. */ function inhibit_communication_with_eventbrite() { // Do nothing if Eventbrite Tickets is not activated if ( ! class_exists( 'Tribe__Events__Tickets__Eventbrite__Main' ) ) return; // Remove update callback $callback = array( tribe( 'eventbrite.main' ), 'action_sync_event' ); remove_action( 'tribe_events_update_meta', $callback, 20 ); } add_action( 'wp_loaded', 'inhibit_communication_with_eventbrite', 100 );
From within WordPress, I then updated the description of an event that I had previously imported from Eventbrite. After saving, the changes were also pushed to Eventbrite. I DO NOT WANT THIS. We have additional content that we need on our website that we DO NOT want on Eventbrite.
Looking at the code, I noticed that the old class name “Tribe__Events__Tickets__Eventbrite__Main” was still being referenced. So I made the following change which is the state of my current code…
/* This function disables syncing from Events Calendar PRO to Eventbrite. */ function inhibit_communication_with_eventbrite() { // Do nothing if Eventbrite Tickets is not activated if ( ! class_exists( 'eventbrite' ) ) return; // Remove update callback $callback = array( tribe( 'eventbrite.main' ), 'action_sync_event' ); remove_action( 'tribe_events_update_meta', $callback, 20 ); } add_action( 'wp_loaded', 'inhibit_communication_with_eventbrite', 100 );
After this latest change, the problem still exists. When I make a change to an event in WordPress, it still updates to the associated Eventbrite event.
Please provide a code fix (or even include as a feature in the plugin) to prevent the syncing back to Eventbrite.
Thanks!
June 28, 2017 at 1:19 pm #1310602BrandonParticipantI seem to have solved this on my own. Reading through the code I see that tribe is a function and not a class so I replaced class_exists with function_exists and the code is now working. This is now the current state…
/* This function disables syncing from Events Calendar PRO to Eventbrite. */ function inhibit_communication_with_eventbrite() { // Do nothing if Eventbrite Tickets is not activated if ( ! function_exists( 'tribe' ) ) return; // Remove update callback $callback = array( tribe( 'eventbrite.main' ), 'action_sync_event' ); remove_action( 'tribe_events_update_meta', $callback, 20 ); } add_action( 'wp_loaded', 'inhibit_communication_with_eventbrite', 100 );
However, I feel like the logic in this code snippet is no longer accomplishing the same result from the original snippet that you guys provided (see the original support ticket). The function_exists condition at the beginning should exit out if the eventbrite plugin is not activated. I’m assuming that the tribe function is used across all of the tribe plugins and, therefore, would still exist if the Eventbrite plugin was not activated.
Please provide an update to this condition.
Thanks.
June 28, 2017 at 2:08 pm #1310622BrandonParticipantI already tried posting this follow-up message once but I don’t see it on my end. Trying again…
I seem to have solved this on my own. Reading through the code I see that tribe is a function and not a class so I replaced class_exists with function_exists and the code is now working. This is now the current state…
/* This function disables syncing from Events Calendar PRO to Eventbrite. */ function inhibit_communication_with_eventbrite() { // Do nothing if Eventbrite Tickets is not activated if ( ! function_exists( 'tribe' ) ) return; // Remove update callback $callback = array( tribe( 'eventbrite.main' ), 'action_sync_event' ); remove_action( 'tribe_events_update_meta', $callback, 20 ); } add_action( 'wp_loaded', 'inhibit_communication_with_eventbrite', 100 );
However, I feel like the logic in this code snippet is no longer accomplishing the same result from the original snippet that you guys provided (see the original support ticket). The function_exists condition at the beginning should exit out if the eventbrite plugin is not activated. I’m assuming that the tribe function is used across all of the tribe plugins and, therefore, would still exist if the Eventbrite plugin was not activated.
Please provide an update to this condition.
Thanks.
June 28, 2017 at 8:59 pm #1311062CliffMemberGood for you!
That original snippet you linked to included
class_exists( 'Event_Tickets_PRO' )
Which checked for Events Calendar PRO, not Eventbrite Tickets.
Event_Tickets_PRO actually isn’t a valid class anymore; it’d be Tribe__Events__Pro__Main now.
Anyway, you could still check if Eventbrite Tickets is active via
class_exists( 'Tribe__Events__Tickets__Eventbrite__Main' )
Please let me know if you have any follow-up questions on this topic.
July 20, 2017 at 9:35 am #1323934Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Additional Editing in WP of Eventbrite Event (Part 3)’ is closed to new replies.