/**
  * Lift_Search_Form constructor.
  */
 private function __construct($wp_query)
 {
     $this->lift_query = Lift_WP_Query::GetInstance($wp_query);
     $this->fields = apply_filters('lift_form_filters', array(), $this);
 }
예제 #2
0
 /**
  * Modifies a WP_Query's post results by using Lift search to get the post
  * ids and returning the associated posts.  WP_Query is updated to reflect the
  * counts returned from the Lift search
  * @param array $posts
  * @param WP_Query $wp_query
  * @return array $posts
  */
 public static function _filter_posts_results($posts, $wp_query)
 {
     $lift_query = Lift_WP_Query::GetInstance($wp_query);
     if ($lift_query->has_valid_result()) {
         return $lift_query->get_posts();
     }
     return $posts;
 }