Remove (not hide!) export links in event views

Home Forums Calendar Products Events Calendar PRO Remove (not hide!) export links in event views

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1347787
    Dinah
    Participant

    Hi 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.
    #1347804
    Dinah
    Participant

    Ok, I should check my glasses 😉 I found it in:

    tribe-events/month/content.php
    tribe-events/day/content.php
    tribe-events/list/content.php

    It 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,
    Dinah

    #1347820
    Mathew
    Participant

    Dinah,

    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.

    #1348354
    Geoff B.
    Member

    Good 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.

    #1350314
    Dinah
    Participant

    Mathew,
    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.php

    I 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,
    Dinah

    #1350952
    Geoff B.
    Member

    Good 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.

    #1361658
    Support Droid
    Keymaster

    Hey 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Remove (not hide!) export links in event views’ is closed to new replies.