Beispiel #1
0
 private function get_notice_json()
 {
     // get notice data from server
     $data = @wp_remote_get($this->server_file, array('sslverify' => false));
     if (isset($data) && !empty($data) && !is_wp_error($data) && $data['response']['code'] == 200) {
         $data = $data['body'];
         // if some data exists
         if ($data != '' || !empty($data)) {
             if (!empty($this->notice_data)) {
                 if (strcmp($data, $this->notice_data) == 0) {
                     // set new cookie for interval value
                     AvadaRedux_Functions::setCookie($this->cookie_id, time(), time() + 86400 * $this->interval, '/');
                     // bail out
                     return;
                 }
             }
             update_option('r_notice_data', $data);
             $this->notice_data = $data;
             // set cookie for three day expiry
             setcookie($this->cookie_id, time(), time() + 86400 * $this->interval, '/');
             // set unique key for dismiss meta key
             update_option($this->cookie_id, time());
         }
     }
 }