Skip to content
IvaSure add-ons and services for SureCart storesJoin the POD waitlist

The PHP filters

3 min read
Published
Category
Reference

IvaSure Filters has no template overrides. Behaviour is extended through WordPress filters instead, which means an override survives an update rather than being replaced by one.

The product query

FilterChanges
ivasure_filters_apply_to_queryWhether IvaSure touches a given query at all.
ivasure_filters_query_argsThe assembled query arguments, before they run.
ivasure_filters_price_meta_keysWhich meta keys hold price.
ivasure_filters_rating_meta_keyWhich meta key holds the average rating. Defaults to average_stars.
ivasure_filter_sibling_query_varsQuery vars treated as belonging to the same filtered view.

Facets and terms

FilterChanges
ivasure_filters_facet_definitionsThe facet catalogue - add a facet type of your own.
ivasure_filters_facet_aliasesAlternative names accepted for a facet token.
ivasure_filters_variant_enumerationThe variant option values offered.
ivasure_filters_price_boundsThe price slider bounds.
ivasure_filters_allow_legacy_other_taxonomiesWhether taxonomies outside the configured set may be filtered.
ivasure_filters_section_search_thresholdHow many options a section needs before it gains a search box.

Output

FilterChanges
ivasure_filters_results_htmlThe rendered results markup.
ivasure_filters_responseThe whole REST response, last.
ivasure_empty_titleThe heading shown when nothing matched.
ivasure_empty_messageThe message shown when nothing matched.
ivasure_filters_storefront_urlWhere admin links point for “view the storefront”.
ivasure_filters_use_native_routerWhether to use the WordPress Interactivity router.

Caching and the index

FilterChanges
ivasure_filters_dynamic_count_ttlHow long facet counts are cached. Five minutes.
ivasure_filters_price_bounds_ttlHow long price bounds are cached. Five minutes.
ivasure_filters_variant_enumeration_ttlHow long variant lists are cached. Five minutes.
ivasure_filters_index_rowA row before it is written to the index table.
ivasure_filters_index_priceThe price value stored in the index.
ivasure_filters_index_stock_statusThe stock status stored in the index.

REST

FilterChanges
ivasure_filters_rest_rate_limitThe request budget, whoever the caller is.
ivasure_filters_rest_anon_rate_limitThe anonymous budget only. Defaults to 300.
ivasure_filters_rest_rate_windowThe window the budget applies over. One minute.
ivasure_filters_rest_max_per_pageThe largest page size a caller may ask for.
ivasure_filters_rest_client_ipHow the real client IP is resolved behind a CDN.
Behind Cloudflare, correct the IP
Rate limiting keys anonymous callers partly on IP address. Behind a proxy every visitor arrives with the same one, so return the forwarded header instead.
Cloudflare
add_filter( 'ivasure_filters_rest_client_ip', function ( $ip ) {
    return $_SERVER['HTTP_CF_CONNECTING_IP'] ?? $ip;
} );

Analytics and enablement

FilterChanges
ivasure_filters_analytics_enabledWhether usage counts are collected.
ivasure_filters_analytics_sample_rateWhat proportion of applications are counted.
ivasure_filters_enabledWhether the Filters module runs at all.
Extension points are not a settings API
A filter changes behaviour for every request on the site, including the admin preview, and leaves no trace in the settings screen. When a setting exists for what you want, use the setting - the next person to look will find it.

Save to list