Brandon

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Additional Editing in WP of Eventbrite Event (Part 3) #1310622
    Brandon
    Participant

    I 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.

    in reply to: Additional Editing in WP of Eventbrite Event (Part 3) #1310602
    Brandon
    Participant

    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.

    in reply to: Additional Editing in WP of Eventbrite Event (Part 3) #1310583
    Brandon
    Participant

    Sorry 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!

    in reply to: Additional Editing in WP of Eventbrite Event (Part 2) #990473
    Brandon
    Participant

    This updated snippet worked. Thanks.

    • This reply was modified 10 years, 8 months ago by Brandon.
    in reply to: Additional Editing in WP of Eventbrite Event #940408
    Brandon
    Participant

    Cool. Thanks for the help.

    in reply to: Additional Editing in WP of Eventbrite Event #940349
    Brandon
    Participant

    Thank 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?

Viewing 6 posts - 1 through 6 (of 6 total)