false, 'show_keywords' => $show_keywords, 'show_history' => $show_history, 'show_posts' => $show_posts, ]); if ($search === '' || $search === null) { wp_die('0'); } // zibll contract: outer dropdown + inner .search-input. echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped wp_die(); } endif; if (!function_exists('aksrt_ajax_search_box')) : /** * AJAX: full Zibll search box loaded into the footer shell on first open. */ function aksrt_ajax_search_box(): void { $nonce = isset($_REQUEST['nonce']) ? sanitize_text_field(wp_unslash((string) $_REQUEST['nonce'])) : ''; if (!wp_verify_nonce($nonce, 'aksrt_public_nonce') || !function_exists('aksrt_get_search_box')) { wp_die('0'); } echo aksrt_get_search_box([ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 'show_form' => true, 'show_keywords' => !class_exists('\\AKSRT\\Settings\\Settings') || \AKSRT\Settings\Settings::hot_search_enabled(), 'show_history' => !class_exists('\\AKSRT\\Settings\\Settings') || \AKSRT\Settings\Settings::search_history_enabled(), 'show_posts' => !class_exists('\\AKSRT\\Settings\\Settings') || \AKSRT\Settings\Settings::search_posts_enabled(), 'show_type' => !class_exists('\\AKSRT\\Settings\\Settings') || (bool) \AKSRT\Settings\Settings::get_value('search_type', true), 'show_input_cat' => !class_exists('\\AKSRT\\Settings\\Settings') || \AKSRT\Settings\Settings::search_cat_enabled(), ]); wp_die(); } endif; if (!function_exists('aksrt_footer_navbar_search')) : /** * Zibll footer search shell. The heavy search body is loaded once via remote-box. */ function aksrt_footer_navbar_search(): void { $show_on_404 = class_exists('\\AKSRT\\Settings\\Settings') ? (bool) \AKSRT\Settings\Settings::get_value('404_search_s', true) : true; if (is_search() || (is_404() && $show_on_404)) { return; } $remote = aksrt_get_remote_box([ 'type' => 'load', 'class' => '', 'loader' => '

', 'query' => [ 'action' => 'search_box', 'nonce' => wp_create_nonce('aksrt_public_nonce'), ], ]); echo ''; } endif; if (!function_exists('aksrt_ajax_zibll_current_user_ping')) : /** Satisfy the reference runtime's one-shot user-state refresh request. */ function aksrt_ajax_zibll_current_user_ping(): void { wp_send_json_success([ 'logged_in' => is_user_logged_in(), 'user_id' => get_current_user_id(), ]); } endif; add_action('wp_ajax_menu_search', 'aksrt_ajax_menu_search'); add_action('wp_ajax_nopriv_menu_search', 'aksrt_ajax_menu_search'); add_action('wp_ajax_search_box', 'aksrt_ajax_search_box'); add_action('wp_ajax_nopriv_search_box', 'aksrt_ajax_search_box'); add_action('wp_ajax_get_current_user', 'aksrt_ajax_zibll_current_user_ping'); add_action('wp_ajax_nopriv_get_current_user', 'aksrt_ajax_zibll_current_user_ping'); add_action('wp_footer', 'aksrt_footer_navbar_search', 10);