Skip to content

Instantly share code, notes, and snippets.

@elimn
Last active March 8, 2017 14:25
Show Gist options
  • Select an option

  • Save elimn/df638214c7bb3b734e8e818e043d2729 to your computer and use it in GitHub Desktop.

Select an option

Save elimn/df638214c7bb3b734e8e818e043d2729 to your computer and use it in GitHub Desktop.

Revisions

  1. elimn revised this gist Feb 24, 2017. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion Tribe__Snippet__Change_All_Link.php
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,6 @@ 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 &&
  2. elimn created this gist Feb 24, 2017.
    37 changes: 37 additions & 0 deletions Tribe__Snippet__Change_All_Link.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    <?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' );