SHARE
TWEET

Possible fix #25806

BakerMan Feb 10th, 2014 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function fix_25806_listen() {
  2.         $comment_squashing = ! ( tribe_get_option('tribeEventsTemplate', 'default') == '' );
  3.         $non_event_page = ! tribe_is_event_query();
  4.  
  5.         if ( $non_event_page && $comment_squashing ) {
  6.                 add_filter( 'comments_template', 'fix_25806_catch', 5 );
  7.                 add_filter( 'comments_template', 'fix_25806_reinstate', 25 );
  8.         }
  9. }
  10.  
  11. function fix_25806_store( $template = null ) {
  12.         static $tpl = '';
  13.         if ( null === $template ) return $tpl;
  14.         $tpl = $template;
  15. }
  16.  
  17. function fix_25806_catch( $template ) {
  18.         fix_25806_store( $template );
  19. }
  20.  
  21. function fix_25806_reinstate() {
  22.         return fix_25806_store();
  23. }
  24.  
  25. add_action( 'pre_get_posts', 'fix_25806_listen' );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top