Dinah

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Remove (not hide!) export links in event views #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

    in reply to: Remove (not hide!) export links in event views #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

    Dinah
    Participant

    😀 I resolved it by myself!

    <?php foreach ( $fields as $name => $value ): ?>
    			
    				<dt> <?php echo esc_html( $name );  ?> </dt>
    				<dd class="tribe-meta-value">
    					<?php
    					// prüfen ob das der Wert des Custom Fields = Anmeldung ist, dann Link formatieren
    					
    					if ( $value == $fields['Anmeldung'] ) { 
    						echo "<a href='$value' class='tribe-events-button' target='_blank'>Jetzt anmelden !</a>";
    					
    					// andernfalls die Ausgabe ganz normal fortführen
    					} else {
    						echo $value;
    					}
    					?>					
    				</dd>
    			
    			<?php endforeach ?>

    Many thanks, this ticket can be closed.

    Best regards, Dinah

    in reply to: Event detail page "URL" should contain target="_blank" #1174294
    Dinah
    Participant

    Sorry, my fault – I hadn’t pasted the code correctly into the functions.php. It is resolved.

    in reply to: Event detail page "URL" should contain target="_blank" #1174289
    Dinah
    Participant

    Hi Cliff,

    sorry I was too fast :-/ Unfortunately there is another problem now.

    I pasted your code into my child-themes’ function.php and it really worked well – all links open up in a new window – as expected… BUT… each time I try to update a post in the wp backend the following error message appears:

    Warning: Cannot modify header information – headers already sent by…

    What did I do wrong? Or maybe did I misunderstand you in how to use your code?

    in reply to: Event detail page "URL" should contain target="_blank" #1174222
    Dinah
    Participant

    Thank you very much, Cliff! That works 🙂

Viewing 6 posts - 1 through 6 (of 6 total)