Created
June 19, 2014 14:30
-
-
Save barryhughes/31f3941071ea54b102c5 to your computer and use it in GitHub Desktop.
Quick hack to remove "Upcoming Events >" (photo view/category applied/TEC 3.6.x)
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 | |
add_action( 'tribe_pre_get_view', 'occassionally_kill_pro_title_filter' ); | |
function occassionally_kill_pro_title_filter() { | |
remove_action( 'tribe_pre_get_view', 'occassionally_kill_pro_title_filter' ); | |
if ( ! tribe_is_photo() ) return; // You could extend or further limit when this runs | |
remove_filter( 'tribe_get_events_title', array( TribeEventsPro::instance(), 'reset_page_title')); | |
add_filter( 'tribe_get_events_title', 'modify_events_title' ); | |
} | |
function modify_events_title( $title ) { | |
$anglebracket = '›'; | |
$position = strpos( $title, $anglebracket ); | |
if ( $position <= 0 ) return $title; | |
return substr( $title, $position + strlen( $anglebracket ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment