name = "admin_head"; } public function handle() { if (!current_user_can('manage_options')) return; if (!isset($_GET['page'])) return; $isChatbotPreview = $_GET['page'] === aimuse()->name() . '-chatbot-preview'; if (!$isChatbotPreview) return; $chatbotId = isset($_GET['id']) ? $_GET['id'] : null; echo ""; echo ""; $shorcode = new ChatbotShortCode(); $shorcode->isPreview = true; echo $shorcode->show([ 'id' => $chatbotId, ]); do_action('admin_print_footer_scripts'); echo ""; exit; } }