is_async() public static method

public static is_async ( )
示例#1
0
 public function process()
 {
     global $wp_rewrite;
     if (is_admin() or QM_Util::is_async()) {
         return;
     }
     if (!($request = QM_Collectors::get('request'))) {
         return;
     }
     if (empty($wp_rewrite->rules)) {
         return;
     }
     $req = $request->data['request']['request'];
     $matching = array();
     foreach ($wp_rewrite->rules as $match => $query) {
         if (preg_match("#^{$match}#", $req)) {
             $matching[$match] = $query;
         }
     }
     $this->data['matching'] = $matching;
 }
示例#2
0
文件: Html.php 项目: L0k1slnk/weddly
 public function is_active()
 {
     if (!$this->user_can_view()) {
         return false;
     }
     if (!$this->did_footer) {
         return false;
     }
     if (QM_Util::is_async()) {
         return false;
     }
     # Don't process if the minimum required actions haven't fired:
     if (is_admin()) {
         if (!did_action('admin_init')) {
             return false;
         }
     } else {
         if (!(did_action('wp') || did_action('login_init'))) {
             return false;
         }
     }
     # Back-compat filter. Please use `qm/dispatch/html` instead
     if (!apply_filters('qm/process', true, is_admin_bar_showing())) {
         return false;
     }
     return true;
 }
示例#3
0
 public function active()
 {
     if (!$this->qm->user_can_view()) {
         return false;
     }
     if (!(did_action('wp_footer') or did_action('admin_footer') or did_action('login_footer'))) {
         return false;
     }
     if (QM_Util::is_async()) {
         return false;
     }
     return true;
 }