Default Organizer for imported ical feed

Home Forums Calendar Products Event Aggregator Default Organizer for imported ical feed

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1011526
    Dan Armstrong
    Participant

    I have the Events Calendar Free version with purchased Filter Bar and iCal importer add-ons. This is for a school district website with a centralized calendar compiling events from our 8 schools. The filter bar works great for allowing users to filter out and just see events from the school(s) they are interested in. One of our schools has a third-party athletics calendar that has hundreds of events and frequent changes to time/venue/etc. I purchased the ical importer to be able to subscribe our central calendar to their updates. However, the iCal importer does not allow me to set an organizer for their feed, which would be key for our system. In addition, their third-party calendar does not include an organizer field. Is there a way to set an event organizer per imported feed? Alternatively, I noticed that Events Calendar PRO offers the ability to set a default organizer for events. I upgrade to PRO, will the default organizer I set up there be set for events imported via the iCal Importer?

    #1011709
    Nico
    Member

    Howdy Dan,

    Welcome to our support forums and thanks for reaching out to us. Hopefully I can help you out with this one!

    First of all, Events Calendar PRO default content feature won’t help here ๐Ÿ™ So a bit of custom code will be needed here, please try pasting this snippet in your theme’s functions.php file – located at wp-content/themes/your_theme/:


    add_action( 'tribe_events_update_meta', 'set_default_event_meta' );

    function set_default_event_meta ( $event_id ) {

    $default_venue_id = 1871;
    $default_organizer_id = 1893;

    $venue_id = get_post_meta( $event_id, '_EventVenueID', true );
    $organizer_id = get_post_meta( $event_id, '_EventOrganizerID', true );

    if ( !$venue_id ) update_post_meta( $event_id, '_EventVenueID', $default_venue_id );
    if ( !$organizer_id ) update_post_meta( $event_id, '_EventOrganizerID', $default_organizer_id );
    }

    Haven’t tested exhaustively, but it seems to be doing the trick! Replace default IDs in the code – you can see Venue and Organizer IDs present in the URL when you are editing them in the back-end.

    Please let me know if it works for you,
    Best,
    Nico

    #1011839
    Dan Armstrong
    Participant

    This does seem to have done the trick. Thank you!

    #1011908
    Nico
    Member

    Hey Dan,

    Stocked to help you out on this one ๐Ÿ™‚

    Iโ€™ll go ahead and close out this thread, but if you need help with anything else please donโ€™t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Default Organizer for imported ical feed’ is closed to new replies.