Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Removes the Tribe post_class filter on the first occasion that filter is
- * used, then sets it up again for future calls.
- *
- * @param array $classes
- * @return array
- */
- function remove_tribe_cat_once(array $classes) {
- static $count = 0;
- if ($count++ === 0) {
- remove_filter('post_class', array(TribeEvents::instance(), 'post_class'));
- }
- else {
- add_filter('post_class', array(TribeEvents::instance(), 'post_class'));
- remove_filter('post_class', 'remove_tribe_cat_once');
- }
- return $classes;
- }
- // Try to stop the first event category from being added to the article classes
- // (when the default page template is used)
- add_filter('post_class', 'remove_tribe_cat_once', 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement