예제 #1
0
 function get_results()
 {
     //$this->hard_remove_filters();
     if (isset($_GET['sfid']) && isset($_GET['sf_action'])) {
         //get_form
         $sf_action = esc_attr($_GET['sf_action']);
         if (esc_attr($_GET['sfid']) != "" && ($sf_action == "get_results" || $sf_action == "get_form")) {
             global $searchandfilter;
             $sfid = (int) $_GET['sfid'];
             $sf_inst = $searchandfilter->get($sfid);
             if ($sf_action == "get_results") {
                 if ($sf_inst->settings("display_results_as") == "shortcode") {
                     $results = array();
                     $results['form'] = $this->display_shortcode->display_shortcode(array("id" => $sfid));
                     $results['results'] = $sf_inst->query()->the_results();
                     echo Search_Filter_Helper::json_encode($results);
                     exit;
                 }
             } else {
                 if ($sf_action == "get_form") {
                     $results = array();
                     $results['form'] = $this->display_shortcode->display_shortcode(array("id" => $sfid));
                     echo Search_Filter_Helper::json_encode($results);
                     exit;
                 }
             }
         }
     }
 }
 public function cache_progress()
 {
     $cache_json = $this->cache_options;
     unset($cache_json['cache_list']);
     echo Search_Filter_Helper::json_encode($cache_json);
     if ($this->cache_options['rc_status'] == "") {
         //then we need to test for a remote connection
         $this->can_wp_remote_post();
     }
     if ($this->cache_options['rc_status'] == "connect_success") {
         //there is a remote connection error, so don't try remote call
         $query_args = array("action" => "refresh_cache");
         $url = add_query_arg($query_args, admin_url('admin-ajax.php'));
         $this->wp_remote_post_with_cookie($url);
         //run in the background - calls refresh_cache()
     } else {
         $this->refresh_cache();
     }
     /*if(($this->cache_options['locked']==false)&&($this->cache_options['rc_status']))
     		{
     			//refresh_cache
     		}*/
     exit;
 }