Hooks reference

Every action and filter the plugins provide, when it runs, and examples you can copy.

FreePro

Free: actions

ActionArgumentsWhen
siteryn_is_loaded$pluginAfter the plugin booted, only when requirements are met
siteryn_is_upgrade$installed, $currentOn init (priority 20) when the stored version differs from the running one, before it is updated
siteryn_is_enqueue_assets$settingsAfter the assets were enqueued, on active archives only
siteryn_is_controls_after$settings, $context, $paginationInside the controls, before the scroll sentinel
siteryn_is_before_template · siteryn_is_after_template$template_name, $argsAround each template
siteryn_is_settings_reset$sectionAfter Reset to Defaults
siteryn_is_settings_panel_top$section, $active_sectionTop of every tab's main panel, under its heading
siteryn_is_settings_sidebar_top$sectionTop of a tab's right-hand sidebar (only on tabs with a sidebar: Appearance and tabs with a Reset card)

Free: filters

FilterArguments → returnUse
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, $settingsWhether a context is switched on
siteryn_is_pagination_state$state, $queryCurrent page, totals and next URL
siteryn_is_should_load$should, $context, $pagination, $settingsFinal decision on wp (Pro uses priority 20)
siteryn_is_frontend_config$config, $settingsThe JavaScript config, e.g. timeout or selectors
siteryn_is_inline_css$css, $settingsThe inline CSS variables
siteryn_is_locate_template$path, $template_nameFinal template path
siteryn_is_settings_get_all$settingsChange Free settings at runtime. Runs in wp-admin too: guard with is_admin()
siteryn_is_settings_sections · _fieldsarray → arrayAdd settings tabs and fields
siteryn_is_settings_nav_visible · _nav_badge · _nav_icon · _nav_sublabel · _description$value, $sectionA tab's visibility, badge, icon, sublabel and description
siteryn_is_settings_save_redirectfalse, $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$iconsThe 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$urlWhere the optional deactivation survey is sent (shared by every Siteryn plugin)

Pro: actions and filters

HookArgumentsUse
siteryn_is_pro_loaded · siteryn_is_pro_upgrade · siteryn_is_pro_deactivateactionBooted · updated · deactivated
siteryn_is_pro_license_activated · _deactivatedaction: $outcome · $doneAfter license activation or deactivation
siteryn_is_pro_rulefilter: {mode, per_page, source}, $context, $termThe resolved mode and products per page
siteryn_is_pro_frontend_configfilter: $pro, $pro_settingsPro's JavaScript config (mode, history, prefetch, saveData, restore, i18n, …)
siteryn_is_pro_settings_get_allfilter: $settingsPro settings at runtime (cached after the first call per request)
siteryn_is_pro_settings_fieldsfilter: $fieldsPro's settings fields
siteryn_is_pro_page_has_gridfilter: $found, $postWhether a page has a page builder grid
siteryn_is_pro_filter_compatfilter: {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' ) );