Fields

Fields can be added to your search form by creating & extending the ‘fields’ key of your arguments array. Each value in the ‘fields’ array contains an array storing arguments for that field. Fields will be generated on the page in the order they are defined.

$args = array();
$args['wp_query'] = array('post_type' => 'post', 'posts_per_page' => 5);
$args['fields'][] = array('type' => 'search');
$args['fields'][] = array('type' => 'author');
$args['fields'][] = array('type' => 'taxonomy');
...
register_wpas_form('myform',$args);

Field Types

There are a variety of field types available for use in your search forms. They are:

Field types are defined by passing the ‘type’ argument within the field’s arguments array.

Example: Creating a taxonomy field

$args['fields'][] = array('type' => 'taxonomy');

Field Formats

Fields can be constructed in a variety of formats, such as: text inputs, select boxes, checkboxes, radio buttons, and multi-select. You can specify a field’s format by passing a ‘format’ parameter to the field’s arguments:

$args['fields'][] = array('type' => 'taxonomy', 'format' => 'select');

The above code will create a taxonomy field as a select box. For more information, consult the documentation on field formats & parameters.