Advertisement
BakerMan

Pos temp fix for Woo/Sealight slider

Jan 15th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. class Tribe_Fix_25231
  2. {
  3.     protected static $restore = false;
  4.  
  5.  
  6.     public static function run() {
  7.         add_action( 'parse_query', array( __CLASS__, 'check' ), 40 );
  8.         add_action( 'parse_query', array( __CLASS__, 'amend' ), 60 );
  9.     }
  10.  
  11.     public static function check( $query ) {
  12.         if ( ! $query->is_main_query() && is_home() ) self::$restore = true;
  13.     }
  14.  
  15.     public static function amend( $query ) {
  16.         if ( self::$restore ) $query->is_home = true;
  17.     }
  18. }
  19.  
  20. Tribe_Fix_25231::run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement