Advertisement
BakerMan

Use the category in category view titles

Jan 24th, 2014
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. add_filter( 'tribe_get_events_title', 'change_upcoming_events_title' );
  2.  
  3. function change_upcoming_events_title( $title ) {
  4.     // We're only interested in categories here
  5.     if ( ! tribe_is_event_category() ) return $title;
  6.    
  7.     // Derive the name of the requested category
  8.     $minimal_formatting = array( 'before' => '', 'sep' => '', 'after' => '' );
  9.     $category = strip_tags( tribe_get_event_taxonomy( null,  $minimal_formatting ) );
  10.    
  11.     // Build our replacement title
  12.     return esc_html( "Upcoming $category" );
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement