Hooks reference
Every action and filter the plugins provide, when it runs, and examples you can copy.
Free: actions
| Action | Arguments | When |
|---|---|---|
siteryn_is_loaded | $plugin | After the plugin booted, only when requirements are met |
siteryn_is_upgrade | $installed, $current | On init (priority 20) when the stored version differs from the running one, before it is updated |
siteryn_is_enqueue_assets | $settings | After the assets were enqueued, on active archives only |
siteryn_is_controls_after | $settings, $context, $pagination | Inside the controls, before the scroll sentinel |
siteryn_is_before_template · siteryn_is_after_template | $template_name, $args | Around each template |
siteryn_is_settings_reset | $section | After Reset to Defaults |
siteryn_is_settings_panel_top | $section, $active_section | Top of every tab's main panel, under its heading |
siteryn_is_settings_sidebar_top | $section | Top of a tab's right-hand sidebar (only on tabs with a sidebar: Appearance and tabs with a Reset card) |
Free: filters
| Filter | Arguments → return | Use |
|---|---|---|
siteryn_is_supported_contexts | $contexts (key ⇒ label) | Register archive contexts |
siteryn_is_current_context | $context → key or '' | Which context this request is; '' turns loading off |
siteryn_is_context_enabled | $enabled, $context, $settings | Whether a context is switched on |
siteryn_is_pagination_state | $state, $query | Current page, totals and next URL |
siteryn_is_should_load | $should, $context, $pagination, $settings | Final decision on wp (Pro uses priority 20) |
siteryn_is_frontend_config | $config, $settings | The JavaScript config, e.g. timeout or selectors |
siteryn_is_inline_css | $css, $settings | The inline CSS variables |
siteryn_is_locate_template | $path, $template_name | Final template path |
siteryn_is_settings_get_all | $settings | Change Free settings at runtime. Runs in wp-admin too: guard with is_admin() |
siteryn_is_settings_sections · _fields | array → array | Add settings tabs and fields |
siteryn_is_settings_nav_visible · _nav_badge · _nav_icon · _nav_sublabel · _description | $value, $section | A tab's visibility, badge, icon, sublabel and description |
siteryn_is_settings_save_redirect | false, $option_name → false or [ 'tab' => …, 'message' => … ] | Block an AJAX save and send the admin to another tab |
siteryn_is_settings_reset_actions | $actions (option name ⇒ admin-post action) | Give an add-on's option a Reset to Defaults card |
siteryn_is_system_status_cards | $cards (label, value, icon, variant) | System Status summary cards; runs only while Pro is active |
siteryn_is_admin_icons | $icons | The settings screen's icon set |
siteryn_dashboard_plugins | $plugins (slug, title, icon) | Cards on the shared Siteryn → Welcome page (unprefixed, shared by every Siteryn plugin) |
siteryn_deactivation_feedback_endpoint | $url | Where the optional deactivation survey is sent (shared by every Siteryn plugin) |
Pro: actions and filters
| Hook | Arguments | Use |
|---|---|---|
siteryn_is_pro_loaded · siteryn_is_pro_upgrade · siteryn_is_pro_deactivate | action | Booted · updated · deactivated |
siteryn_is_pro_license_activated · _deactivated | action: $outcome · $done | After license activation or deactivation |
siteryn_is_pro_rule | filter: {mode, per_page, source}, $context, $term | The resolved mode and products per page |
siteryn_is_pro_frontend_config | filter: $pro, $pro_settings | Pro's JavaScript config (mode, history, prefetch, saveData, restore, i18n, …) |
siteryn_is_pro_settings_get_all | filter: $settings | Pro settings at runtime (cached after the first call per request) |
siteryn_is_pro_settings_fields | filter: $fields | Pro's settings fields |
siteryn_is_pro_page_has_grid | filter: $found, $post | Whether a page has a page builder grid |
siteryn_is_pro_filter_compat | filter: {observe, jqueryEvents, domEvents} | AJAX filter detection. Event names must be lowercase a-z 0-9 _ - |
Examples
Turn it off for one category
add_filter( 'siteryn_is_current_context', function ( $context ) {
return is_product_category( 'gift-cards' ) ? '' : $context;
} );
This also stops Pro. If you use siteryn_is_should_load instead, use a priority above 20. Without code, wrap the grid in .siteryn-is-disable.
Load More button for one category
add_filter( 'siteryn_is_settings_get_all', function ( $s ) {
if ( ! is_admin() && did_action( 'wp' ) && is_product_category( 'outlet' ) ) {
$s['loading_mode'] = 'load_more';
}
return $s;
}, 30 );
With Pro, an archive rule does this without code.
Products per page (and per load)
add_filter( 'loop_shop_per_page', function ( $n ) {
return is_product_category() ? 24 : $n;
}, 20 );
A Pro products-per-page rule above 0 takes priority.
Product tags in Free
add_filter( 'siteryn_is_supported_contexts', function ( $c ) {
$c['my_tags'] = 'Product tags';
return $c;
} );
add_filter( 'siteryn_is_current_context', function ( $ctx ) {
return ( '' === $ctx && is_product_tag() ) ? 'my_tags' : $ctx;
} );
add_filter( 'siteryn_is_context_enabled', function ( $on, $ctx ) {
return 'my_tags' === $ctx ? true : $on;
}, 10, 2 );
Longer timeout and button style
add_filter( 'siteryn_is_frontend_config', function ( $config ) {
$config['timeout'] = 30000; // ms
return $config;
} );
add_filter( 'siteryn_is_inline_css', function ( $css ) {
return $css . '.siteryn-is-controls{--siteryn-is-button-radius:999px}';
} );
Pro: rules and filters
// Normal pagination on the "sale" term, whatever the settings say.
add_filter( 'siteryn_is_pro_rule', function ( $rule, $context, $term ) {
if ( $term && 'sale' === $term->slug ) {
$rule['mode'] = 'off';
}
return $rule;
}, 10, 3 );
// Recognize your filter plugin's jQuery event.
add_filter( 'siteryn_is_pro_filter_compat', function ( $compat ) {
$compat['jqueryEvents'][] = 'my-filter-done';
return $compat;
} );
// Turn off Return to the same spot.
add_filter( 'siteryn_is_pro_frontend_config', function ( $pro ) {
$pro['restore'] = false;
return $pro;
} );
Your own AJAX swap
// After replacing the products inside the same list: SiterynInfiniteScroll.get().reset(); // After replacing the list element itself: SiterynInfiniteScroll.get().destroy(); SiterynInfiniteScroll.create( document.querySelector( 'ul.products' ) );