Is there a hook for events imported via the iCal Importer

Home Forums Calendar Products Event Aggregator Is there a hook for events imported via the iCal Importer

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1100140
    Keith
    Participant

    Hi,

    I’d like to execute custom code when events are imported via the iCal Importer. Is this a hook for this?

    Regards,
    Keith

    #1100721
    Josh
    Participant

    Hey Keith,

    Thanks for reaching out to us!

    This is a great question! After a quick look through the files, I’m not seeing any hooks that we’ve added that fire after the import. However, I’ll check with one of our developers to see if they’re aware of anything that would be useful here. If not, we’ll get a feature request added for the ability to hook in after the import.

    Thanks!

    #1101296
    Josh
    Participant

    Hey Keith,

    I spoke with one of our developers and there unfortunately isn’t a hook that we have built into the plugin that would fire for imported events.

    However, there is an approach that you could take that would allow you to hook into the default WordPress save post function and conditionally run your code if it originated from an import. This would look something like:

    
    add_action( 'wp_ajax_tribe_events_ical-importer_run_saved_import_query', function() {
        add_action( 'save_post_tribe_events', function( $event ) {
            // Code here should execute when an event is saved during the iCal import process
        }
    }, 5 );
    

    Let me know if this helps.

    Thanks!

    #1102348
    Keith
    Participant

    Hi Josh,

    Thanks for that. I’ll give it a try.

    Regards,
    Keith

    #1102981
    Josh
    Participant

    Hey Keith,

    No problem! Let me know how it goes.

    Thanks!

    #1109107
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Is there a hook for events imported via the iCal Importer’ is closed to new replies.