Forum Replies Created
-
AuthorPosts
-
June 28, 2017 at 2:08 pm in reply to: Additional Editing in WP of Eventbrite Event (Part 3) #1310622
Brandon
ParticipantI 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 1:19 pm in reply to: Additional Editing in WP of Eventbrite Event (Part 3) #1310602Brandon
ParticipantI 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 1:04 pm in reply to: Additional Editing in WP of Eventbrite Event (Part 3) #1310583Brandon
ParticipantSorry 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!
Brandon
ParticipantThis updated snippet worked. Thanks.
-
This reply was modified 10 years, 8 months ago by
Brandon.
Brandon
ParticipantCool. Thanks for the help.
Brandon
ParticipantThank you very much for this. Just a note, this wasn’t working for me using the plugins_loaded hook. I changed to use the wp_loaded hook and now it works as expected… any change I do to the event within WordPress does not update Eventbrite.
Is there a reason why this doesn’t work for plugins_loaded but does for wp_loaded? Is it somehow wrong or dangerous to use wp_loaded instead?
-
This reply was modified 10 years, 8 months ago by
-
AuthorPosts
