Home › Forums › Calendar Products › Events Calendar PRO › Remove (not hide!) export links in event views
- This topic has 7 replies, 3 voices, and was last updated 8 years, 6 months ago by
Dinah.
-
AuthorPosts
-
September 11, 2017 at 5:23 pm #1347787
Dinah
ParticipantHi there,
I found different posts similar to my thread, but unfortunately with no solution.
I want to remove (not hide via CSS) the export button from the month view page. So I tried to use the plugin you recommended in this post: https://theeventscalendar.com/knowledgebase/removing-export-links-event-views/ Unfortunately it did not work.
But I found a newer Post from January with the same topic: https://theeventscalendar.com/support/forums/topic/removing-export-links-from-event-views/ Unfortunately the recommended and updated snippet did not work, too.
First Question:
Due to the fact that I do not want to use CSS (because I do not want to hide but remove the buttons) is there a timing when the plugin / Snippet will be repaired and updated?Second Question:
I guess the only way to remove the code is by making a template customization. Could you please tell me in which file of the tribe templates I can make these changes ? I already made some changes so i am aware of the Themer’s Guide and have created custom files 😉 But I could not find the corresponding lines in the “tribe events -> month.php” nor “tribe events -> month -> …”Many thanks in advance,
Dinah-
This topic was modified 8 years, 7 months ago by
Dinah.
September 11, 2017 at 6:02 pm #1347804Dinah
ParticipantOk, I should check my glasses 😉 I found it in:
tribe-events/month/content.php
tribe-events/day/content.php
tribe-events/list/content.phpIt is the “do_action( ‘tribe_events_after_footer’ )” part at the bottom (around line 58):
<!-- #tribe-events-footer --> <?php //delete it or make it a comment to not show the export button any longer on views //do_action( 'tribe_events_after_footer' ) ?>Best regards,
DinahSeptember 11, 2017 at 7:23 pm #1347820Mathew
ParticipantDinah,
It’s great that you found the templates!!! The articles that you mentioned above are outdated.
Tribe__Events__iCal has been depreciated and replaced with tec.iCal.
Here’s an article that will remove them in different views.
Hope this helps.
September 12, 2017 at 6:52 pm #1348354Geoff B.
MemberGood evening Dinah and welcome back!
Thank you for reaching out to us.
I would love to help you with this topic.Due to the fact that I do not want to use CSS (because I do not want to hide but remove the buttons) is there a timing when the plugin / Snippet will be repaired and updated?
I just updated the following snippet: https://gist.github.com/GeoffEW/b8f0bb5fc2b8510c6ad4f0b60fcf3fb9
You could apply it in the functions.php file of your theme (without the PHP tag at the top).
I guess the only way to remove the code is by making a template customization. Could you please tell me in which file of the tribe templates I can make these changes ? I already made some changes so i am aware of the Themer’s Guide and have created custom files ? But I could not find the corresponding lines in the “tribe events -> month.php” nor “tribe events -> month -> …”
As Mathew kindly points out, why try to dig deeper when a little piece of code does the trick 🙂
Let me know how that goes.
Best regards,
Geoff B.September 16, 2017 at 6:11 pm #1350314Dinah
ParticipantMathew,
Geoff,thank you so much! I directly changed it and instead of having it still in 6 files
tribe-events/month/content.php
tribe-events/day/content.php
tribe-events/list/content.php
tribe-events/pro/week/content.php
tribe-events/pro/map/content.php
tribe-events/pro/photo/content.phpI just had to put it one time in the functions.php <3
Great! Because I wanted to keep the export buttons on the event detail page I just commented out the single_event_links parts – works well 🙂
/** * Prevent calendar export links from showing anywhere on the front-end. */ class Tribe__Events__Remove__Export__Links { public function __construct() { /*add_action( 'init', array( $this, 'single_event_links' ) ); */ add_action( 'init', array( $this, 'view_links' ) ); } /* public function single_event_links() { remove_action( 'tribe_events_single_event_after_the_content', array( $this->ical_provider(), 'single_event_links' ) ); } */ public function view_links() { remove_filter( 'tribe_events_after_footer', array( $this->ical_provider(), 'maybe_add_link' ) ); } protected function ical_provider() { return function_exists( 'tribe' ) ? tribe( 'tec.iCal' ) // Current : 'Tribe__Events__iCal'; // Legacy } } new Tribe__Events__Remove__Export__Links();Best regards,
DinahSeptember 18, 2017 at 9:45 pm #1350952Geoff B.
MemberGood evening Dinah,
Sounds like you have the perfect solution going on. Kudos!
Is there anything I can help you with on this topic ?
Best regards,
Geoff B.
October 10, 2017 at 9:35 am #1361658Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
This topic was modified 8 years, 7 months ago by
-
AuthorPosts
- The topic ‘Remove (not hide!) export links in event views’ is closed to new replies.
