Last active
March 8, 2017 14:25
-
-
Save elimn/df638214c7bb3b734e8e818e043d2729 to your computer and use it in GitHub Desktop.
MT | TEC | Change the recurrent events see all page to a different URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Changes the recurrent events see all page to a different URL | |
*/ | |
Class Tribe__Snippet__Change_All_Link { | |
public $all_link_text; | |
public function __construct( $all_text_link = 'all' ) { | |
$this->all_link_text = $all_text_link; | |
add_filter( 'tribe_events_pro_all_link_frag', array( $this, 'tribe_events_pro_all_link_frag' ) ); | |
add_filter( 'gettext_with_context', array( $this, 'gettext_with_context' ), 10, 4 ); | |
} | |
public function tribe_events_pro_all_link_frag( $text ) { | |
return $this->all_link_text; | |
} | |
public function gettext_with_context( $text, $original, $context, $textdomain ) { | |
if ( | |
'the-events-calendar' === $textdomain && | |
'all events slug' === $context && | |
'all' === $original | |
) { | |
$text = $this->all_link_text; | |
} | |
return $text; | |
} | |
} | |
// Change 'alle' to the string that you want used for the recurring all page. | |
new Tribe__Snippet__Change_All_Link( 'alle' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment