Skip to content

Instantly share code, notes, and snippets.

@barryhughes
Created June 19, 2014 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barryhughes/31f3941071ea54b102c5 to your computer and use it in GitHub Desktop.
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)
<?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 = '&#8250;';
$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