Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
- Fixed issue with loading custom AJAX templates
- Added informative error message to debug output when AJAX results template cannot be found
- Renamed WPAS_PATH constant to WPAS_URI, to avoid confusion
Version 1.4 introduces a major overhaul to the codebase along with several exciting new features, including:
- Support for AJAX
- Ability to search meta_keys within a range of values
- Ability to group multiple form inputs under a single search field
- Better compatibility with meta_keys created using Advanced Custom Fields
See the updated documentation for full details.
Support for nested categories and taxonomies
Taxonomies which use nested hierarchies (i.e. parent/child terms) can now be displayed hierarchically by adding the option:
'nested' => true
to the field's configuration settings. This option is only supported for the
'taxonomy' field type, and only works with select, multi-select, checkbox, and radio formats.
In select fields the nesting will be shown using dashes '-', while checkboxes and radio buttons will be displayed using nested
NOTE: This feature only works if you do not supply a custom 'values' array for the field, i.e. you must show all terms by default. But you can still use the 'exclude' option to hide certain terms if you need to. Excluding a term from the list will exclude that term AND all of its children when nesting is enabled.
Support for HTML5 field elements
Form fields can now use a variety of HTML5 field formats such as 'number', 'url', 'email', etc. You can set these formats in your fields' configuration array, like so:
'format' => 'number'
Support for including custom HTML before and after individual fields
It is now possible to include custom HTML before and after any individual form field, using the new options
'pre_html' => '<h2>Some html before my field</h2>',
'post_html => '<span>Some custom html after my field</span>'
Ability to disable wrapper
<div>'s on fields
Every form field generated by WPAS is wrapped in a
<div> element by default. This can now be disabled by setting the following constant:
Attributes can be added to any text or select field by using the new 'attributes' parameter as follows:
$args['fields'] = array('type' => 'search', 'label' => 'Search', 'format' => 'text', 'attributes' => array('data-src' => 12345, 'data-color' => 'red') );
This example will generate HTML for a search field that looks something like this:
<input type="text" data-src="12345" data-color="red" class="wpas-text" name="search_query" >
Added support for adding custom CSS classes to form fields through the use of the new 'class' parameter. See documentation here.
Fixed bug with 'default' parameter
Version 1.1 adds support for 3 new field parameters:
If set to true, this parameter sets the first option of a select field to a null (blank) value.
Used to pre-select all of a field’s options by default. This parameter may only be used with checkbox & multi-select fields.
This parameter allows you to exclude specific options from select, multi-select, checkbox and radio button fields. This is useful if you need to exclude certain option(s) from a field that generates its options automatically (such as a taxonomy field).
Thanks to Braunson for contributing to the addition of "default_all" and "exclude" features.