Hi,
I did setup an ics-import and the url-field of the ics is filled with the url of the originating event, this event is not on my own website.
I would like to setup the widget event-list so that when an user clicks the event he will not get directed to the imported event but to the original event, using the url-field of the ics-feed.
is this possible?
Frans Bosman
Frans Bosman
Hi Frans,
This code snippet will do that. Please note it changes all the links for that event, not just the widget:
add_filter('post_type_link', function($url,$event){
if('event' != get_post_type($event)){
return $url;
}
$ical_url = get_post_meta($event->ID, '_event_ical_url', true);
if($ical_url){
return esc_url_raw($ical_url);
}
return $url;
},10,2);
Stephen Harris
Hi Steven,
I did apply your snippet in functions.php, but the resulting url is not correct, it appends the url I want to the url of the site event organiser is running:
http://vanginkel.fbosman.nl/%3Chttp:/calypsotheater.nl/k/n394/news/view/3322/3090/familiefilm-k3-love-cruise-met-k3-disco.html
I want “http://vanginkel.fbosman.nl/%3” not included, what did I do wrong?
regards,
Frans
Frans Bosman
Hi,
I did solve this issue, made a typo in the php-script.
sorry for the inconvenience
regards,
Frans
Frans Bosman
Glad that’s working for you now 🙂
Stephen Harris