Hooks reference

Every action and filter in Siteryn AI Support Agent and Pro, with exact signatures, checked against the code. Free hooks start with siteryn_ai_support_agent_.

FreeProAPI 1.0

Lifecycle

HookTypeArguments · when
siteryn_ai_support_agent_loadedaction( Plugin $plugin ). Free has booted. Extensions start here.
siteryn_ai_support_agent_upgradeaction( string|false $old_version, string $new_version ). init (20) on a version change.
siteryn_ai_support_agent_deactivateaction(). On deactivation.

Chat pipeline

HookTypeArguments · purpose
…_chat_requestaction( WP_REST_Request $request ). Start of /chat.
…_take_over_messagefilter( bool $take_over, string $message, Conversation $conversation ). Send straight to a person. $message isn't redacted yet.
…_hand_offfilter( ?array $handoff, int $conversation_id ). Return ['status', 'reply'].
…_max_concurrent_requestsfilter( int $limit = 20 ). Site-wide in-flight cap; 0 = none.
…_redact_messagefilter( string $text, bool $contact ). Extra redaction.
…_chat_contextfilter( array $context, string $message, Conversation $conversation ). Add facts, knowledge or products.
…_store_factsfilter( array $facts, string[] $sources ). id => [label, text].
…_knowledge_documentsfilter( array $documents, string[] $sources ). Add searchable knowledge.
…_policy_page_idsfilter( array $ids ). Policy pages used.
…_rank_documentsfilter( array $ranked, string $query, array $documents, int $limit ). Replace the ranking.
…_stop_wordsfilter( string[] $words )
…_promptfilter( array{system,prompt} $parts, array $context, array $settings )
…_system_rulesfilter( array $rules, array $context ). json_shape stays last.
…_parsed_answerfilter( array $answer, int[] $offered, string $message, Conversation $conversation ). AI answers only.
…_reply_cardsfilter( int[] $ids, string[] $cited, array $context ). Posts shown as content cards.
…_chat_resultfilter( array $result, string $message, Conversation $conversation, array $context )
…_chat_answeredaction( array $result, string $message, Conversation $conversation, array $context, ?CompletionResponse $response ). Before saving; $response is null for basic answers.
…_chat_failedaction( string $code, WP_Error $cause ). Provider errors.
…_guest_fingerprintfilter( string $fingerprint ). Real client IP behind a proxy.
…_chat_responsefilter( array $data, array $result, WP_REST_Request $request ). /chat and /contact; add extra HTML or new keys.
…_content_cardsfilter( string $html, int[] $ids )
…_allowed_originsfilter( string[] $hosts ). Allow another origin, e.g. headless.
…_basic_fallbackfilter( ?array $answer, string $stage, string $message, string[] $words, array $context ). $stage: no_terms|no_match.
…_basic_synonymsfilter( array $map ). Synonyms, other languages.
…_basic_products_introfilter( string $intro, array $query )
…_handoff_phrasesfilter( string[] $phrases ). Phrases that offer contact.
…_handoff_explicit_phrasesfilter( string[] $phrases ). Phrases that go straight to a person.

Contact form

HookTypeArguments
…_contact_site_hourly_limitfilter( int $limit = 50 )
…_contact_storefilter( ?Conversation $kept, array $fields, ?Conversation $conversation, int $user_id )
…_contact_emailfilter( array $email, array $fields, ?Conversation $conversation ). to, subject, message, headers.
…_contact_requestaction( array $fields, ?Conversation $conversation ). After the email is sent.

Conversations

HookTypeArguments
…_conversation_createdaction( array $conversation )
…_conversation_statusaction( int $conversation_id, string $new_status, string $old_status )
…_conversation_deletedaction( int $conversation_id )
…_message_addedaction( array $message, array $conversation )
…_retention_daysfilter( int $days )
…_conversations_purgedaction( int $expiry, int $deleted )
…_conversation_statefilter( array $state, array $row )
…_message_viewfilter( array $view, array $message )
…_agent_namefilter( string $name, int $user_id )
…_chat_featurefilter( bool $enabled = false, string $feature ). Free asks for live_chat; extensions add their own features (Pro: attachments).

Live chat & Inbox

HookTypeArguments
…_is_agentfilter( bool $can, int $user_id )
…_agents_availablefilter( bool $available, int[] $online )
…_agent_capabilitiesfilter( string[] $capabilities )
…_handoff_requestedaction( int $conversation_id, bool $online )
…_conversation_acceptedaction( int $conversation_id, int $agent_id, int $previous_agent_id )
…_conversation_releasedaction( int $conversation_id ). Resolve or back to the assistant.
…_handoff_emailfilter( array $email, array $conversation )
…_inbox_urlfilter( string $url, int $conversation_id )
…_inbox_menu_slug · …_is_inbox_screenfilter( string $slug ) · ( bool $is_screen )
…_inbox_filtersfilter( array $definitions )
…_inbox_queryfilter( array $query, string $filter, array $args )
…_inbox_summary · …_inbox_conversationfilter( array $data, array $row )
…_inbox_messagefilter( array $view, array $message, int $conversation_id )
…_inbox_contextfilter( array $items, array $row )
…_inbox_notesfilter( bool $enabled = false )
…_inbox_actionfilter( true|WP_Error|null $result, string $action, array $row, int $agent, array $args ). Runs under the conversation lock.
…_inbox_polledaction( int $agent )
…_inbox_pollfilter( array $data, int $agent )
…_inbox_toolbar · _before_layout · _actions · _composeraction(). Add Inbox UI.

Knowledge, shop & catalog

HookTypeArguments
…_kb_show_in_menufilter( bool|string $show_in_menu = false )
…_shop_activefilter( bool $active )
…_capabilityfilter( string $capability )
…_is_shoppablefilter( bool $shoppable, WC_Product $product )
…_search_resultsfilter( int[] $ids, SearchQuery $query, int $limit )
…_search_stopwords · …_support_wordsfilter( string[] $words )
…_candidatesfilter( int[] $ids, SearchQuery $query, string $message, Conversation $conversation )
…_shop_product_contextfilter( array $context, WC_Product $product, string[] $allowed_fields )
…_shop_queryfilter( ?SearchQuery $query, string $message, Conversation $conversation )
…_product_cardfilter( array $card, WC_Product $product )
…_product_card_afteraction( WC_Product $product, array $card ). Inside product-card.php.
…_product_card_optionsfilter( array $options ). fields, layout, button_text, new_tab.

AI providers

HookTypeArguments
…_providersfilter( array $providers ). Key must equal get_id().
…_provider_configfilter( ProviderConfig $config )
…_max_retriesfilter( int $retries = 1, string $provider_id ). 0–2; only on 429 and 5xx.
…_allow_insecure_local_endpointfilter( bool $allow = false, string $url ). localhost only.

Storefront & templates

HookTypeArguments
…_show_chatfilter( bool $show, string $display_on ). Floating chat only, not the shortcode.
…_chat_configfilter( array $config, array $settings ). window.siterynAisupChat.
…_chat_chipsfilter( array $chips, array $settings ). [{label, message}].
…_chat_chips_labelfilter( string $label = 'Browse', array $settings )
…_chat_avatarfilter( array $avatar, array $settings )
…_show_brandingfilter( bool $show, array $settings )
…_template_pathfilter( string $path, string $name )
…_before_template · …_after_templateaction( string $name, array $args )
…_chat_composer_toolsaction( array $args ). Inside the chat's message bar, before the text field (chat-widget.php).

Admin & settings

HookTypeArguments
…_settings_sections · …_settings_fieldsfilter( array $items )
…_settings_get_allfilter( array $settings ). Runtime only, never saved.
…_settings_reset_actionsfilter( array $actions )
…_settings_save_redirectfilter( false|array $redirect, string $option_name )
…_settings_nav_visiblefilter( bool $visible, string $section )
…_settings_nav_icon · _nav_sublabel · _nav_badge · _settings_descriptionfilter( string $value, string $section )
…_settings_tab_before · _tab_after · _main_after · _sidebaraction( string $section ). _main_after and _sidebar fire on the Chat Widget tab only.
…_before_merged_sectionsaction( string $tab ). Before the sections an extension merged into a Free tab.
…_status_cardsfilter( array $cards ). System Status summary cards (label, value, icon, variant); runs only while an extension (Pro) is active.
…_render_field_{$type}action( array $field, mixed $value, string $name, string $id )
…_sanitize_field_{$type}filter( mixed $default, mixed $raw, array $field )
…_knowledge_toolsaction( string $place ). Add Knowledge Base tools: header (next to the buttons) or panel (below the list).
…_kb_actionfilter( array|WP_Error|null $result, string $do )
…_kb_entryfilter( array $entry, WP_Post $post )
…_kb_starter_entriesfilter( array $entries )
…_privacy_paragraphsfilter( array $paragraphs )
siteryn_dashboard_pluginsfilter( array $plugins ). Shared by every Siteryn plugin: the cards on Siteryn → Welcome (slug, title, icon).
siteryn_deactivation_feedback_endpointfilter( string $url ). Shared: where the optional deactivation survey is sent.

Pro hooks Pro

Prefix siteryn_ai_support_agent_pro_.

HookTypeArguments · purpose
…pro_loadedaction( Plugin $plugin ). Pro booted.
…pro_features_loadedaction( Plugin $plugin ). Premium features loaded (license active).
…pro_upgradeaction( string|false $old, string $new )
…pro_activated · …pro_deactivateaction()
…pro_license_activatedaction( ActivationOutcome $outcome ). After every attempt, including failures.
…pro_license_deactivatedaction( bool $done )
…pro_order_documentfilter( array $document, WC_Order $order )
…pro_order_guidancefilter( string[] $lines, WC_Order $order )
…pro_find_orderfilter( ?WC_Order $order, string $number, int $customer_id ). Custom order numbers.
…pro_guest_order_verifiedaction( int $conversation_id, int $order_id )
…pro_reply_emailfilter( array $email, array $message, array $conversation )
…pro_digest_textfilter( string $text, array $summary )
…pro_stock_alert_addedaction( int $product_id, string $email )
…pro_stock_alert_emailfilter( array $email, WC_Product $product )
…pro_attachment_addedaction( array $message )
…pro_conversation_transferredaction( int $conversation_id, int $to_agent_id, int $from_agent_id )
…pro_conversation_routedaction( int $conversation_id, int $agent_id )
…pro_kb_learnedaction( array $entries, int $conversation_id )
…pro_list_phrasesfilter( array $lists ). sale, new, best, rating.
…pro_content_queryfilter( array $args, string $message )
…pro_content_list_phrasesfilter( array $lists ). latest, popular.
…pro_content_cardfilter( array $card, WP_Post $post )
…pro_lead_capturedaction( int $conversation_id, string $name, string $email )
…pro_webhook_payloadfilter( array $payload, string $event, int $conversation_id )
…pro_webhook_capabilityfilter( string $capability = 'manage_options' )
…pro_is_admin_screenfilter( bool $is_pro_screen, string $hook_suffix )
…pro_admin_configfilter( array $config )
…pro_template_pathfilter( string $path, string $name )
…pro_builder_htmlfilter( string $html, string $context ). block|elementor|bricks.