I am using a view to display filter controls for my custom posts. In the "Search and Pagination" section of the view I have a shortcode like this:
[wpv-control-postmeta field="wpcf-region" class="search-filter-checkbox sub-region" type="checkboxes" url_param="wpv-wpcf-region"]
...and this build a series of checkboxes, one for each possible value in the "region" field.
Is it possible to build a custom list of checkboxes? For example, if I want them to be shown is a specific order, or I only want a subset of them?
Nigel
Supporter
Languages:
English (English )
Spanish (Español )
Timezone:
Europe/London (GMT+00:00)
Instead of using the values established in the custom field settings you can provide your own filter options.
When you insert a filter control for a custom field you have the option to use manually entered values, as you can see in the screenshot.
You'll need to provide display values (the labels) and the actual values to filter by.
That would add "values" and "display_values" attributes to the shortcodes which insert the controls, as described here: https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control-postmeta
You can re-arrange the order, and only include the values required.