Created
April 18, 2018 00:38
-
-
Save wpfangirl/757530009da54e50ae52748eaaace5f6 to your computer and use it in GitHub Desktop.
Relocate Modern Tribe Calendar Export Links Below Event Meta on Single Events
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
/** | |
* Relocate calendar export links below event meta on single events | |
* H/T GeoffEW: https://gist.github.com/GeoffEW/b8f0bb5fc2b8510c6ad4f0b60fcf3fb9 | |
* | |
*/ | |
class Tribe__Events__Remove__Export__Links { | |
public function __construct() { | |
add_action( 'init', array( $this, 'single_event_links' ) ); | |
} | |
public function single_event_links() { | |
remove_action( | |
'tribe_events_single_event_after_the_content', | |
array( $this->ical_provider(), 'single_event_links' ) | |
); | |
add_action( | |
'tribe_events_single_event_after_the_meta', | |
array( $this->ical_provider(), 'single_event_links' ), 5 | |
); | |
} | |
protected function ical_provider() { | |
return function_exists( 'tribe' ) | |
? tribe( 'tec.iCal' ) // Current | |
: 'Tribe__Events__iCal'; // Legacy | |
} | |
} | |
new Tribe__Events__Remove__Export__Links(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment