name = "wp_footer"; } private function hasShortCode() { if (is_front_page() && !get_option('page_on_front')) return false; $hasShortCode = has_shortcode(get_the_content(), 'aimuse_chat'); Log::debug('FooterAction handle', [ 'hasShortCode' => $hasShortCode, ]); return $hasShortCode; } public function handle() { if ($this->hasShortCode()) return; $chatbot = Chatbot::query()->where('is_global', true)->first(); if (!$chatbot) return; echo (new ChatbotShortCode())->show(['chatbot' => $chatbot]); } }