Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * When something other than the Default Events Template is in use a trailing
- * separator can be applied to single event titles ... this code aims to
- * resolve that.
- */
- add_filter('tribe_events_add_title', 'fix_leading_tribal_pipe', 20, 3);
- function fix_leading_tribal_pipe($title, $prev, $sep) {
- // We're only interested if the Default Events Template is *not* in play
- if ('default' !== TribeEvents::instance()->getOption('tribeEventsTemplate')) return $title;
- // Confirmation: ensure separator is the first symbol (there will be a leading space)
- if (1 !== strpos($title, $sep)) return $title;
- // Strip it (account for the leading space)
- return substr($title, strlen($sep) + 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement