Home › Forums › Calendar Products › Event Aggregator › Default Organizer for imported ical feed
- This topic has 3 replies, 2 voices, and was last updated 10 years, 6 months ago by
Nico.
-
AuthorPosts
-
October 5, 2015 at 9:22 am #1011526
Dan Armstrong
ParticipantI 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?
October 5, 2015 at 8:06 pm #1011709Nico
MemberHowdy 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,
NicoOctober 6, 2015 at 6:35 am #1011839Dan Armstrong
ParticipantThis does seem to have done the trick. Thank you!
October 6, 2015 at 7:39 am #1011908Nico
MemberHey 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 -
AuthorPosts
- The topic ‘Default Organizer for imported ical feed’ is closed to new replies.
