Advertisement
BakerMan

Possible fix #25806

Feb 10th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  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' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement