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; }
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; }
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; }