=== Skills for Life extensions for Store Locator ===
Contributors: skillsforlife
Requires at least: 6.0
Requires PHP: 7.4
Stable tag: 1.25
License: GPLv2 or later

Adds Scout section and meeting information, filterable locator shortcodes and Scout-specific presentation to WP Store Locator.

== Requirements ==

WP Store Locator must be active. Version 1.25 supports WP Store Locator 2.3.x and 3.0.x.

WP Store Locator supports one interactive locator per page. Use only one of the filterable locator shortcodes on a page.

== Filterable map shortcodes ==

= All filters =

The main shortcode shows Category, Section and Meeting night dropdowns:

`[sfl_wpsl_locator]`

Each filter can be `dropdown`, `checkboxes` or `off`:

`[sfl_wpsl_locator category_filter_type="checkboxes" section_filter_type="dropdown" meeting_night_filter_type="checkboxes" checkbox_columns="3"]`

= Section only =

`[sfl_wpsl_sections]`

Restrict both the choices and map results to selected sections:

`[sfl_wpsl_sections section_filter_type="checkboxes" sections="squirrels,beavers,cubs,scouts,explorers,network" section_selection="explorers" checkbox_columns="3"]`

Create a fixed Explorers-only map without showing a section control:

`[sfl_wpsl_sections section_filter_type="off" sections="explorers"]`

= Category only =

Category values are WP Store Locator category slugs (numeric term IDs are also accepted):

`[sfl_wpsl_categories category_filter_type="checkboxes" categories="drey,colony,pack,troop,explorer-unit,network" category_selection="explorer-unit" checkbox_columns="6"]`

Create a fixed map for selected categories without showing a category control:

`[sfl_wpsl_categories category_filter_type="off" categories="explorer-unit,network"]`

= Meeting night only =

`[sfl_wpsl_meeting_nights meeting_night_filter_type="dropdown" meeting_nights="monday,tuesday,wednesday,thursday,friday"]`

= Combined example =

`[sfl_wpsl_locator category_filter_type="checkboxes" categories="drey,colony,pack,troop,explorer-unit,network" section_filter_type="checkboxes" sections="squirrels,beavers,cubs,scouts,explorers,network" meeting_night_filter_type="dropdown" meeting_nights="monday,tuesday,wednesday,thursday,friday" checkbox_columns="3"]`

Within one checkbox group, selecting several values matches any of them. Between filter groups, the filters are combined: a result must match the selected category AND section AND meeting night. When Section and Meeting night are both filtered, they must belong to the same section meeting record.

An allowlist such as `sections="cubs,scouts"` or `categories="pack,troop"` also limits map results when the visitor chooses the Any option. Use `all` or leave the attribute empty to avoid that restriction.

== Supported attributes ==

* `category_filter_type`: `dropdown`, `checkboxes` or `off`.
* `section_filter_type`: `dropdown`, `checkboxes` or `off`.
* `meeting_night_filter_type`: `dropdown`, `checkboxes` or `off`.
* `categories` or `category_allow`: comma-separated category slugs or IDs.
* `sections` or `section_allow`: squirrels, beavers, cubs, scouts, explorers, network, sasu.
* `meeting_nights` or `meeting_night_allow`: monday through sunday.
* `category_selection`, `section_selection`, `meeting_night_selection`: initial values.
* `checkbox_columns`: 1 to 6 (the custom layout collapses responsively on narrower screens).
* `category_label`, `section_label`, `meeting_night_label`: visible filter labels.
* `location_label`, `radius_label`, `results_label`: labels for the native WPSL location, radius and result-count filters. Leave the text empty to use WPSL's translated label.
* `category_label_visibility`, `section_label_visibility`, `meeting_night_label_visibility`, `location_label_visibility`, `radius_label_visibility`, `results_label_visibility`: `show`, `hide` or `auto`. Hidden labels remain available to screen readers. `auto` preserves the existing layout defaults.
* `show_category_label`, `show_section_label`, `show_meeting_night_label`, `show_location_label`, `show_radius_label`, `show_results_label`: concise `true`/`false` aliases for the matching visibility attributes.
* `category_any_label`, `section_any_label`, `meeting_night_any_label`: dropdown Any labels.
* `layout`: `default` or `below_map`.
* Native map options: `start_location`, `auto_locate`, `map_type`, `start_marker`, `store_marker`.

The concise aliases `category_type`, `section_type` and `meeting_night_type` are also accepted.

For example, this gives one locator custom visible native labels while visually hiding the two custom filter labels:

`[sfl_wpsl_locator location_label="Enter a postcode" show_location_label="true" radius_label="Distance" show_radius_label="true" show_section_label="false" show_meeting_night_label="false"]`

Global defaults for all six label families are available under **Scout Groups > SFL WPSL Settings** (and **Settings > SFL WPSL Settings**). Shortcode attributes take precedence for an individual locator.

== Indexing ==

Section and meeting-night data is stored by the original extension as JSON. Version 1.20 automatically creates queryable derived metadata on first load and refreshes it whenever a Scout Group is saved. This allows WPSL to apply the custom filters before radius/result limits.

== Changelog ==

= 1.25 =

* restored the Section and Meeting Nights editor with both WPSL 2 and WPSL 3 meta-box markup
* restored the Group or Unit Necker editor with both WPSL 2 and WPSL 3 meta-box markup
* versioned the store-editor script so repaired JavaScript is not hidden by an old browser cache
* prevented the custom editor controls from submitting the store form when clicked
* kept WPSL 3 filter values left aligned and removed the extension-level outer gap below the toolbar

= 1.24 =

* restored a neutral gap below the locator filter toolbar without reintroducing the coloured strip
* kept WP Store Locator 3's autocomplete wrapper at the full available search-field width
* retained the existing filter and map stacking compatibility rules

= 1.23 =

* restored the attached desktop search control after WP Store Locator 3.x added inline margins and a native input border
* removed the extra gap below the filter toolbar and reset map margins introduced by the WPSL 3 responsive stylesheet
* kept open Section and Meeting night dropdowns above the map, results panel and mobile List/Map toggle

= 1.22 =

* Added native WP Store Locator 3 map markup while retaining WP Store Locator 2 compatibility.
* Prevented WPSL 3's late legacy-template map rename from racing the Skills for Life layout and mobile controls.

= 1.21 =

* Added global show/hide and custom-text settings for Category, Section, Meeting night, Location, Search radius and Results labels.
* Added per-shortcode label visibility and native-label text overrides.
* Kept visually hidden labels associated with their controls for accessible names.
* Added capability, nonce and input validation to the extension settings save action.

= 1.20 =

* Fixed Section and Meeting night dropdown filtering with WPSL's styled dropdowns.
* Kept native select values and styled dropdown labels synchronized after selection and reset.
* Added consistent filter-family classes and improved mobile dropdown stacking.

= 1.19 =

* Improved the filter form layout so Search sits beside the location field on desktop.
* Visually hid redundant field labels while retaining accessible names for assistive technology.
* Improved section checkbox spacing, contrast and responsive presentation.

= 1.18 =

* Added `[sfl_wpsl_locator]` with Category, Section and Meeting night filters.
* Added section-only, category-only and meeting-night-only locator shortcodes.
* Added dropdown/checkbox display choices, allowlists and initial selections.
* Added signed filter scopes and cache-safe WPSL AJAX integration.
* Added automatic section/meeting-night filter indexes.
* Preserved all existing `[sfl_wpsl]` output shortcodes and single-store templates.
