The PHP filters
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
| Filter | Changes |
|---|---|
ivasure_filters_apply_to_query | Whether IvaSure touches a given query at all. |
ivasure_filters_query_args | The assembled query arguments, before they run. |
ivasure_filters_price_meta_keys | Which meta keys hold price. |
ivasure_filters_rating_meta_key | Which meta key holds the average rating. Defaults to average_stars. |
ivasure_filter_sibling_query_vars | Query vars treated as belonging to the same filtered view. |
Facets and terms
| Filter | Changes |
|---|---|
ivasure_filters_facet_definitions | The facet catalogue - add a facet type of your own. |
ivasure_filters_facet_aliases | Alternative names accepted for a facet token. |
ivasure_filters_variant_enumeration | The variant option values offered. |
ivasure_filters_price_bounds | The price slider bounds. |
ivasure_filters_allow_legacy_other_taxonomies | Whether taxonomies outside the configured set may be filtered. |
ivasure_filters_section_search_threshold | How many options a section needs before it gains a search box. |
Output
| Filter | Changes |
|---|---|
ivasure_filters_results_html | The rendered results markup. |
ivasure_filters_response | The whole REST response, last. |
ivasure_empty_title | The heading shown when nothing matched. |
ivasure_empty_message | The message shown when nothing matched. |
ivasure_filters_storefront_url | Where admin links point for “view the storefront”. |
ivasure_filters_use_native_router | Whether to use the WordPress Interactivity router. |
Caching and the index
| Filter | Changes |
|---|---|
ivasure_filters_dynamic_count_ttl | How long facet counts are cached. Five minutes. |
ivasure_filters_price_bounds_ttl | How long price bounds are cached. Five minutes. |
ivasure_filters_variant_enumeration_ttl | How long variant lists are cached. Five minutes. |
ivasure_filters_index_row | A row before it is written to the index table. |
ivasure_filters_index_price | The price value stored in the index. |
ivasure_filters_index_stock_status | The stock status stored in the index. |
REST
| Filter | Changes |
|---|---|
ivasure_filters_rest_rate_limit | The request budget, whoever the caller is. |
ivasure_filters_rest_anon_rate_limit | The anonymous budget only. Defaults to 300. |
ivasure_filters_rest_rate_window | The window the budget applies over. One minute. |
ivasure_filters_rest_max_per_page | The largest page size a caller may ask for. |
ivasure_filters_rest_client_ip | How 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.
add_filter( 'ivasure_filters_rest_client_ip', function ( $ip ) {
return $_SERVER['HTTP_CF_CONNECTING_IP'] ?? $ip;
} );Analytics and enablement
| Filter | Changes |
|---|---|
ivasure_filters_analytics_enabled | Whether usage counts are collected. |
ivasure_filters_analytics_sample_rate | What proportion of applications are counted. |
ivasure_filters_enabled | Whether 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.
Was this page helpful?
Thanks for your feedback.
There was a problem submitting your feedback. Please try again later.