Hooks reference
Every action and filter the plugins provide, with their arguments. Filters unless marked (action).
Lifecycle
| Hook | Arguments | Use |
|---|---|---|
siteryn_raq_loaded (action) | $plugin | Free booted with all requirements met; extensions start here |
siteryn_raq_pro_loaded (action) | $pro | Pro is running (licensed or not); Free then hides Get Premium |
siteryn_raq_pro_features_loaded (action) | $pro | Pro's features started (license active) |
siteryn_raq_activated · siteryn_raq_deactivated · siteryn_raq_pro_activated · siteryn_raq_pro_deactivated (actions) | - | Plugin activation and deactivation |
siteryn_raq_upgrade · siteryn_raq_pro_upgrade (actions) | $old_version, $new_version | On init when the stored version differs ($old_version is false on a fresh install) |
siteryn_raq_migrate_settings | $stored, $from_schema, $to_schema, $option_name | Reshape stored settings (Free's or Pro's option) before they are rewritten on upgrade |
Access and products
| Hook | Arguments | Use |
|---|---|---|
siteryn_raq_enabled | $enabled | Turn quote requests on or off (default: the setting) |
siteryn_raq_allow_guests | $allowed | Whether signed-out visitors may quote |
siteryn_raq_user_can_quote | $allowed, $user_id | Allow or block quoting for a visitor (for example by role) |
siteryn_raq_supported_product_types | $types | Product types that can be quoted (default simple, variable; variation follows variable) |
siteryn_raq_allow_out_of_stock | $allowed | Whether out-of-stock products can be quoted |
siteryn_raq_is_product_quotable | $quotable, $product, $context | Final say per product. $context: loop, single, shortcode, add, list, submit. Pro rules use priority 20 |
siteryn_raq_show_button | $show, $product, $context | Show or hide the button only (the product stays quotable) |
siteryn_raq_button_args | $args, $product, $context | Template arguments of the button: labels, classes, mode (form, in-form, link), icon, redirect… |
siteryn_raq_product_has_cart_form | $has_form, $product | Whether the product page has a cart form (otherwise the button is printed in the summary) |
siteryn_raq_loop_card_hooks | $hooks | Extra product-card actions (hook => priority) that print the loop button; default the Siteryn theme's siteryn_product_card_after_body |
Quote list
| Hook | Arguments | Use |
|---|---|---|
siteryn_raq_quote_list | $list, $user_id | Replace the QuoteList instance (for example with your own storage) |
siteryn_raq_add_item_data | $data, $product, $quantity | Extra scalar data stored on a line; lines with different data are kept apart |
siteryn_raq_add_item_validation | $valid, $product, $quantity, $data | Return a WP_Error (its message is shown) or false to refuse an add |
siteryn_raq_max_item_quantity · siteryn_raq_max_list_items | $max | Per-line quantity limit (9999) · different products per list (100) |
siteryn_raq_item_added · siteryn_raq_item_quantity_updated · siteryn_raq_item_meta_updated (actions) | $key, $item, $list | After a line is added or changed |
siteryn_raq_item_removed (action) | $key, $removed_item, $list | After a line is removed |
siteryn_raq_list_cleared (action) | $list | After the list is emptied (for example after sending) |
siteryn_raq_item_display_data | $display, $item, $product | What the list shows for a line (name, attributes, SKU, image, price HTML…) |
siteryn_raq_ajax_response | $data, $action, $list | Data returned by the list endpoints (add, update, remove, get) |
siteryn_raq_quote_page_content | $html, $list | The list and form HTML on the quote page |
siteryn_raq_quote_page_id | $page_id | The quote page used for links |
Quote form and submission
| Hook | Arguments | Use |
|---|---|---|
siteryn_raq_form_fields | $fields | Add, change or remove form fields. See Adding a form field |
siteryn_raq_customer_prefill | $data | Pre-filled name, email, phone and company |
siteryn_raq_validate_submission | $errors, $values, $fields | Add errors to the WP_Error (code = field key) to reject a request |
siteryn_raq_min_submit_seconds | $seconds | Minimum time between loading and sending for guests (2) |
siteryn_raq_client_ip | $ip | The IP used for the rate limit (for example behind a proxy) |
siteryn_raq_item_snapshot | $snapshot, $item, $product | What is stored for each product on the request. Pro removes the price of hidden-price products |
siteryn_raq_quote_data | $data | The full request data before it is saved |
siteryn_raq_quote_created (action) | $quote_id, $quote | After a request is saved; also triggers the two emails |
Quote requests
| Hook | Arguments | Use |
|---|---|---|
siteryn_raq_quote_number | $number, $quote | The displayed number (default the post ID) |
siteryn_raq_quote_statuses | $statuses | Status key => label (New is always kept). Pro adds its workflow statuses |
siteryn_raq_quote_status_changed (action) | $quote_id, $new_status, $old_status | After a status change |
siteryn_raq_quote_post_type_args | $args | Arguments for register_post_type() |
siteryn_raq_quote_anonymized (action) | $quote_id | After a request was anonymized by the personal data eraser |
siteryn_raq_admin_quote_columns | $columns | Columns of the Quote Requests list |
siteryn_raq_admin_quote_column (action) | $column, $quote | Print a custom column |
siteryn_raq_admin_quote_meta_boxes (action) | - | Add boxes to the request screen (add_meta_box() for siteryn_raq_quote) |
Templates, emails and assets
| Hook | Arguments | Use |
|---|---|---|
siteryn_raq_locate_template | $path, $template_name | Use another template file |
siteryn_raq_template_args | $args, $template_name | Variables passed to a template |
siteryn_raq_before_template · siteryn_raq_after_template (actions) | $template_name, $args | Around every template |
siteryn_raq_before_quote_list · siteryn_raq_after_quote_list (actions) | $items | Around the list |
siteryn_raq_quote_list_item_meta (action) | $item | Under each line's name (Pro prints the target price field) |
siteryn_raq_before_quote_form · siteryn_raq_after_quote_form (actions) | $fields | Around the form |
siteryn_raq_quote_form_before_submit (action) | - | Just before the submit button |
siteryn_raq_quote_success (action) | $quote | Inside the thank-you message |
siteryn_raq_email_quote_details (action) | $quote, $sent_to_admin, $plain_text, $email | After the request details in both request emails (Pro adds Target prices) |
siteryn_raq_enqueue_assets | $needed | Load the storefront CSS and JS on the current page |
siteryn_raq_script_config | $config | window.siterynRaq: endpoints, nonce, quote page URL, texts |
siteryn_raq_css_vars | $vars | CSS variables (--siteryn-raq-* => value) |
Settings screen
| Hook | Arguments | Use |
|---|---|---|
siteryn_raq_settings_sections | $sections | Tabs: key => label, optional option_group/option_name or render_callback |
siteryn_raq_settings_fields | $fields | Field registry: section, group, type, label, default, help, choices, depends… |
siteryn_raq_settings_description · _nav_icon · _nav_sublabel · _nav_badge | $value, $section | A tab's header text, menu icon, menu sublabel and badge |
siteryn_raq_settings_nav_groups | $groups | Menu groups (Settings, Pro Features, Manage) |
siteryn_raq_settings_nav_group · _nav_parent · _nav_visible | $value, $section | A tab's menu group, parent menu item, and whether it is listed |
siteryn_raq_settings_nav_parent_label · _sectab_label | $label, $section | Menu item and section tab labels |
siteryn_raq_settings_panel_sidebar_cards | $cards, $section | Callables that print sidebar cards |
siteryn_raq_settings_panel_sidebar_shortcodes | $shortcodes, $section | Entries of the Shortcodes card |
siteryn_raq_settings_after_form (action) | $section | After a tab's form (Pro prints the rule builder here) |
siteryn_raq_settings_save_redirect | $redirect, $option_name | Return array( 'tab' => …, 'message' => … ) to refuse an AJAX save |
siteryn_raq_settings_reset_actions | $actions | Option name => admin-post reset action |
siteryn_raq_settings_reset (action) | $section | After a tab was reset |
siteryn_raq_system_status_cards | $cards, $pro_active | Summary cards on System Status |
siteryn_raq_system_status_quote_rows | $rows | Quote Setup rows |
siteryn_dashboard_plugins | $plugins | Shared by all Siteryn plugins: entries on the Siteryn welcome page |
siteryn_deactivation_feedback_endpoint | $url | Shared: where the optional deactivation survey is sent |
Pro
| Hook | Arguments | Use |
|---|---|---|
siteryn_raq_pro_matched_rule | $rule, $product, $user_id | The rule that applies to a product and visitor (null for none) |
siteryn_raq_pro_hidden_price_text | $text, $actions | Text shown instead of a hidden price |
siteryn_raq_pro_rules_saved (action) | $rules | After the rules were saved |
siteryn_raq_pro_offer_saved (action) | $quote_id | After Save quote |
siteryn_raq_pro_offer_sent (action) | $quote_id, $access_key | After an offer was sent; triggers the offer email |
siteryn_raq_pro_offer_accepted (action) | $quote_id | The customer accepted |
siteryn_raq_pro_offer_declined (action) | $quote_id, $reason | The customer declined |
siteryn_raq_pro_quote_converted (action) | $quote_id, $order | After an order was created from a quote |
siteryn_raq_pro_quote_view (action) | $quote | Inside the customer's quote view |
siteryn_raq_pro_pdf_rendered (action) | $pdf, $quote | After the PDF is drawn; add content with the writer object |
siteryn_raq_pro_license_active | $active, $status | Whether the license counts as active |
siteryn_raq_pro_license_changed (action) | $active, $status | The license switched between active and inactive |
siteryn_raq_pro_system_status_cards | $cards | Pro's System Status cards |
siteryn_raq_pro_admin_config | $config | Configuration of Pro's admin script |
add_filter( 'siteryn_raq_user_can_quote', function ( $allowed, $user_id ) {
return $allowed && ! user_can( $user_id, 'no_quotes' );
}, 10, 2 );