PHP actions and filters reference
Use these hooks from a custom plugin or must-use plugin. Do not edit Cliq Store Locator files because an update will replace those changes. Hook names beginning cliq_sl_ belong to Store Locator; cliqthemes_ui_ hooks extend its shared Builder framework.
Action
cliq_sl_fs_loaded
Runs after the Freemius SDK helper has initialized. It receives no arguments. Use it only for code that specifically requires the Store Locator Freemius instance.
add_action('cliq_sl_fs_loaded', function (): void {
// Freemius-dependent integration boot code.
});
Search and public payload filters
cliq_sl_search_allowed_ids
apply_filters('cliq_sl_search_allowed_ids', ?array $allowed_ids, WP_REST_Request $request): ?array
Runs after Category, Brand, keyword, custom-field, language, status, and open-now constraints are intersected, before location pagination and Store formatting. Return null for no ID constraint, an integer ID array to permit only those Stores, or [] to return no Stores. Use this for membership visibility, territories, or server-enforced restrictions.
cliq_sl_search_results
apply_filters('cliq_sl_search_results', array $response, WP_REST_Request $request): array
Filters the completed /search response containing results, total, page, per_page, unit, and optional designs and categoryCounts. Use it for aggregate data or response-level additions. Preserve the required keys consumed by Map, Store List, Load more, and category counts.
cliq_sl_store_payload
apply_filters('cliq_sl_store_payload', array $formatted, Store $store, ?float $distance): array
Filters one serialized Store used by search results and markers. The payload already contains resolved location, categories, Brand, metadata, opening hours, open-now state, detail URL, marker, and distance when coordinates exist.
add_filter('cliq_sl_store_payload', function (array $payload): array {
$payload['booking_available'] = ! empty($payload['meta']['booking_url']);
return $payload;
});
Builder and rendering filters
cliq_sl_design_html
apply_filters('cliq_sl_design_html', string $html, array $model, array $store): string
Filters server-rendered Store Card, infobox, marker/detail design HTML. Return safe complete HTML. This is applied per rendered design, so avoid database queries inside the callback.
cliq_sl_token_value
apply_filters('cliq_sl_token_value', mixed $value, array $context): mixed
Changes one PHP-rendered dynamic field. Context includes token, record, meta, format, raw, tokens, and item. It is the PHP counterpart of the frontend cliqui.token_value filter. Extend both paths if a value must match before and after hydration.
cliq_sl_ssr_bootstrap
apply_filters('cliq_sl_ssr_bootstrap', array $bootstrap, int $template_id, array $defaults): array
Filters the bootstrap JSON embedded by server-side rendering. It contains the Layout/template, first search response, and required Categories/field options. Returning [] suppresses bootstrap and makes the app start in lazy-load mode over the static markup.
cliq_sl_locator_purposes
apply_filters('cliq_sl_locator_purposes', array $purposes): array
Extends the saved-design purposes Layout widgets can bind to. Built-ins are list_item, infobox, search, marker, and category_tile. Adding a purpose also requires a renderer/consumer; adding only a label does not make a new widget functional.
cliqthemes_ui_builder_schema
Filters the Builder schema produced by BuilderControls. Use it to modify domain control definitions before they are returned.
cliqthemes_ui_builder_controls
Filters the complete Builder bootstrap configuration injected into the admin app. Use it for option sets and read-only context. Do not add a persisted control only here because this filter does not register its server sanitizer.
cliqthemes_ui_builder_control_registry
apply_filters(
'cliqthemes_ui_builder_control_registry',
\CliqThemes\UI\Controls\ControlRegistry $registry
): \CliqThemes\UI\Controls\ControlRegistry
Registers Builder controls at the authoritative PHP boundary. The filtered registry drives both the React inspector schema and server-side model sanitization. See Extend Builder controls from PHP.
Settings and admin filters
cliq_sl_settings_defaults
apply_filters('cliq_sl_settings_defaults', array $defaults): array
Registers custom setting keys and defaults. A custom key must be added here before it will survive normal settings sanitization/persistence.
cliq_sl_settings_sanitize
apply_filters('cliq_sl_settings_sanitize', array $clean, array $raw_values): array
Final pass after built-in type and enum sanitization. Return the sanitized settings array, never the raw request.
cliq_sl_admin_store_filters
apply_filters('cliq_sl_admin_store_filters', array $filters, array $store_form, ProviderContext $context): array
Adds or changes filters in the admin Store grid. This does not affect public locator search.
Maps, assets, and geocoding filters
| Filter | Value/arguments | Intended use |
|---|---|---|
cliq_sl_geocoder | null, provider name | Return a custom geocoder implementation for the selected provider |
cliq_sl_nominatim_min_interval | Seconds, default 1.0 | Increase/decrease the minimum gap between Nominatim requests while respecting its policy |
cliq_sl_leaflet_js | Asset URL | Replace the bundled Leaflet JavaScript URL |
cliq_sl_leaflet_css | Asset URL | Replace the bundled Leaflet stylesheet URL |
cliq_sl_leaflet_cluster_js | Asset URL | Replace Leaflet.markercluster JavaScript |
cliq_sl_leaflet_cluster_css | Asset URL | Replace its structural cluster CSS |
cliq_sl_leaflet_cluster_css_default | Asset URL | Replace its default theme CSS |
cliq_sl_google_cluster_js | Asset URL | Replace the bundled Google marker-clusterer URL |
cliq_sl_glide_js | Asset URL | Replace the bundled Glide dropdown JavaScript |
cliq_sl_glide_css | Asset URL | Replace the bundled Glide dropdown stylesheet |
Asset filters run while scripts/styles are registered. Return a public URL and preserve compatibility with the bundled version; a mismatched API can break every locator.
SEO and forms
cliq_sl_store_schema
apply_filters('cliq_sl_store_schema', array $schema, array $store): array
Filters Store detail JSON-LD after address, coordinates, and opening-hours specifications are built.
cliq_sl_recaptcha_threshold
Filters the reCAPTCHA v3 score threshold, default 0.5. It affects v3 responses only; v2 checkbox responses have no score and use their success result.
add_filter('cliq_sl_recaptcha_threshold', static fn (): float => 0.7);
Compatibility warning
Treat payload and Builder filters as application code: validate types, avoid throwing exceptions, and test lazy-load and server-side rendering. Returning a string where a filter expects an array can break the REST response or Builder for every user.