A WordPress PHP Composer Package that provides you with an easy way to display and process forms, render and validate fields, and display error/success messages.
You can install Nomad Forms in your project by using composer.
$ composer require jakesutherland/nomad-forms
Nomad Forms depends on the following packages:
- Nomad Helpers for various functions, constants, and utilities.
- Nomad Validate for validating form submissions and generating error messages.
If for some reason you didn't install Nomad Forms via Composer as a required package in your project, you will still need to run composer install
to install it's dependencies as they are not included in the repository.
Nomad Forms is a full-featured form generator for processing, validating and displaying forms on your website. You can use Nomad Forms on the front-end or in the admin.
The nomad_form()
function is used to get your form configured and set up.
The first parameter is your form ID. In our example below, my_form_id
is used as a unique identifer for this form.
The second parameter is your form arguments. This is where you can configure your form and define your form fields.
$my_form = nomad_form( 'my_form_id', array(
'method' => 'POST',
'callback' => 'my_form_callback',
'fields' => array(
// Add your form fields here...
),
) );
Alternatively, you can use the nomad_fields()
function if you want to output just form fields (and still utilize Nomad Forms Theme styles). Basically is a helper function that sets various form arguments to what would be needed in order to just output form fields. See below:
function nomad_fields( $id, $args ) {
$defaults = array(
'action' => null,
'method' => null,
'nonce' => true,
'form_tag' => false,
'submit_button' => false,
'reset_button' => false,
'cancel_button' => false,
'callback' => null,
);
$args = wp_parse_args( $args, $defaults );
return nomad_form( $id, $args );
}
When using this by itself, you would be expected to handle all form processing and validation manually.
Common use case would be adding custom fields to a post type in the WordPress admin and then processing those fields on save_post
.
You can customize how a form behaves with many different form arguments available.
Note: The only required form argument is fields
. All other form arguments are optional and have defaults set.
Type: string
Default: null
Sets the form action if you want the form to be submitted to a specific URL.
This is not recommended unless you plan on handling the form submission yourself. Note that the variable you assign nomad_form()
to is only available on the page it is defined, so the other functions likely won't be available somewhere else in your codebase. It is highly recommended that you handle everything on the same page that the form is being displayed on.
Type: boolean
Default: true
Whether or not you want to allow the potential for other plugins or pieces of code to modify the form.
When set to true
, the form can be modified through various hooks, filters and fields added through injections. If set to false
, the majority of hooks and filters won't be triggered and form injections will not add any fields.
Type: boolean
Default: true
Whether or not you want to allow automatic validation of form fields.
When set to true
, automatically validates values for "choice" type fields (such as button groups, checkboxes, radios, selects, etc) and makes sure that only the options that were available can be used, email fields are valid emails, and numeric fields only contain numbers.
If you already specify any of these rule keys in your field validation, automatic validation will not override them.
Type: callable
Default: null
The function to be called to process the form when it is successful. Must be a valid callback function.
Type: boolean
Default: false
Whether or not to display a "Cancel" button at the bottom of the form.
Type: string
Default: home_url( '/' );
(your WordPress installs homepage)
The URL to go to when the Cancel button is clicked.
Type: string
Default: Cancel
The Cancel button text.
Type: string
Default: Sorry, there was a problem submitting your form:
When the form is submitted and there is an error, this is the text to be displayed above the list of error messages.
Type: array
Required
The list of form fields to be displayed, submitted validated, and processed.
Type: boolean
Default: true
Whether or not the form fields should be rendered inside a <form>...</form>
tag. If set to false
, the form fields will be rendered inside a <div>...</div>
instead.
Type: string
Default: left
Possible Values: left
center
right
Determines the text alignment of the field labels.
Type: string
Default: top
Possible Values: inline
top
Determines where the field labels are displayed in relation to its field.
Type: string
Default: POST
Possible Values: POST
GET
Determines the form method that is used when the fields are submitted.
Type: boolean
Default: true
Whether or not to create and use a nomad_form_nonce
to make sure that the form being processed is the one that was just submitted.
Type: string
Default: Invalid form submission. Please try again.
The text to be displayed if the nonce verification fails and the form submission was invalid.
Type: boolean
Default: false
Whether or not to display a "Reset" button at the bottom of the form.
Type: string
Default: Reset
The Reset button text.
Type: boolean
Default: true
Whether or not to display a "Submit" button at the bottom of the form.
Type: string
Default: Submit
The Submit button text.
Type: string
Default: Success! Your form has been submitted.
When the form is submitted and there is an error, this is the text to be displayed above the list of error messages.
Each field is defined as a constant in the Nomad_Form_Fields
class. Below is a list of all available fields and an example of how it would be registered.
Alternatively, you can take a look at example.php to test out a Nomad Form that contains one of every field type available.
Usage: Nomad_Form_Fields::AM_PM
Select dropdown menu with AM and PM options.
'example_am_pm' => array(
'name' => 'example_am_pm',
'label' => 'AM PM Field',
'type' => Nomad_Form_Fields::AM_PM,
),
Usage: Nomad_Form_Fields::BUTTON_GROUP
Styled radio buttons. If the multiple
argument is provided and set to true
then the styled buttons will behave like checkboxes.
'example_button_group' => array(
'name' => 'example_button_group',
'label' => 'Button Group Field',
'type' => Nomad_Form_Fields::BUTTON_GROUP,
'multiple' => true,
'options' => array(
'a' => 'Choice A',
'b' => 'Choice B',
'c' => 'Choice C',
),
),
Usage: Nomad_Form_Fields::CHECKBOX
A single checkbox.
'example_checkbox' => array(
'name' => 'example_checkbox',
'label' => 'Checkbox Field',
'type' => Nomad_Form_Fields::CHECKBOX,
'checkbox_text' => 'Checkbox text.',
),
Usage: Nomad_Form_Fields::CHECKBOXES
Multiple checkboxes.
'example_checkboxes' => array(
'name' => 'example_checkboxes',
'label' => 'Checkboxes Field',
'type' => Nomad_Form_Fields::CHECKBOXES,
'options' => array(
'a' => 'Choice A is the longest option<br>it has three lines<br>how about that?',
'b' => 'Choice B is much longer<br>spans a couple lines',
'c' => 'Choice C is the shortest',
),
),
Usage: Nomad_Form_Fields::COUNTRY
Select dropdown menu with list of all countries as options.
'example_country' => array(
'name' => 'example_country',
'label' => 'Country Field',
'type' => Nomad_Form_Fields::COUNTRY,
),
Usage: Nomad_Form_Fields::DATE
Date input field.
'example_date' => array(
'name' => 'example_date',
'label' => 'Date Field',
'type' => Nomad_Form_Fields::DATE,
),
Usage: Nomad_Form_Fields::DAY
Select dropdown menu with days of the month (01-31) as options.
'example_day' => array(
'name' => 'example_day',
'label' => 'Day Field',
'type' => Nomad_Form_Fields::DAY,
),
Usage: Nomad_Form_Fields::EMAIL
Email input field.
'example_email' => array(
'name' => 'example_email',
'label' => 'Email Field',
'type' => Nomad_Form_Fields::EMAIL,
),
Usage: Nomad_Form_Fields::ENABLE_DISABLE_BUTTON_GROUP
Button group with predefined Enable and Disable options.
'example_enable_disable_button_group' => array(
'name' => 'example_enable_disable_button_group',
'label' => 'Enable Disable Button Group',
'type' => Nomad_Form_Fields::ENABLE_DISABLE_BUTTON_GROUP,
),
Usage: Nomad_Form_Fields::ENABLED_DISABLED_BUTTON_GROUP
Button group with predefined Enabled and Disabled options.
'example_enabled_disabled_button_group' => array(
'name' => 'example_enabled_disabled_button_group',
'label' => 'Enabled Disabled Button Group',
'type' => Nomad_Form_Fields::ENABLED_DISABLED_BUTTON_GROUP,
),
Hidden Field
Usage: Nomad_Form_Fields::HIDDEN
Hidden input field.
'example_hidden' => array(
'name' => 'example_hidden',
'label' => 'Hidden Field',
'type' => Nomad_Form_Fields::HIDDEN,
'value' => 'hidden_value',
),
Usage: Nomad_Form_Fields::HOUR
Select dropdown menu with hours of the day as options. You can specify format
with 12
or 24
to have 1-12 or 0-23 hour format options. Default is 12 hour format.
'example_hour' => array(
'name' => 'example_hour',
'label' => 'Hour Field',
'type' => Nomad_Form_Fields::HOUR,
),
Usage: Nomad_Form_Fields::MINUTE
Select dropdown menu with 00-60
minute options.
'example_minute' => array(
'name' => 'example_minute',
'label' => 'Minute Field',
'type' => Nomad_Form_Fields::MINUTE,
),
Usage: Nomad_Form_Fields::MONTH
Select dropdown menu with months of the year as options. You can specify format
with full
(January-December), short
(Jan-Dec), or number
(1-12) format options. Default format: number
.
'example_month' => array(
'name' => 'example_month',
'label' => 'Month Field',
'type' => Nomad_Form_Fields::MONTH,
),
Usage: Nomad_Form_Fields::NUMBER
Number input field.
'example_number' => array(
'name' => 'example_number',
'label' => 'Number Field',
'type' => Nomad_Form_Fields::NUMBER,
),
Usage: Nomad_Form_Fields::ON_OFF_BUTTON_GROUP
Button group with predefined On and Off options.
'example_on_off_button_group' => array(
'name' => 'example_on_off_button_group',
'label' => 'On Off Button Group',
'type' => Nomad_Form_Fields::ON_OFF_BUTTON_GROUP,
),
Usage: Nomad_Form_Fields::PASSWORD
Password input field.
'example_password' => array(
'name' => 'example_password',
'label' => 'Password Field',
'type' => Nomad_Form_Fields::PASSWORD,
),
Usage: Nomad_Form_Fields::PERCENTAGE
Number input field with a minimum value of 0 and maximum value of 100.
'example_percentage' => array(
'name' => 'example_percentage',
'label' => 'Percentage Field',
'type' => Nomad_Form_Fields::PERCENTAGE,
),
Usage: Nomad_Form_Fields::PHONE
Phone input field.
'example_phone' => array(
'name' => 'example_phone',
'label' => 'Phone Field',
'type' => Nomad_Form_Fields::PHONE,
),
Usage: Nomad_Form_Fields::RADIO
A single radio button.
'example_radio' => array(
'name' => 'example_radio',
'label' => 'Radio Field',
'type' => Nomad_Form_Fields::RADIO,
'radio_text' => 'Radio text.',
),
Usage: Nomad_Form_Fields::RADIOS
Multiple radio buttons.
'example_radios' => array(
'name' => 'example_radios',
'label' => 'Radios Field',
'type' => Nomad_Form_Fields::RADIOS,
'options' => array(
'a' => 'Choice A',
'b' => 'Choice B',
'c' => 'Choice C',
),
),
Usage: Nomad_Form_Fields::SELECT
Select dropdown menu.
'example_select' => array(
'name' => 'example_select',
'label' => 'Select Field',
'type' => Nomad_Form_Fields::SELECT,
'options' => array(
'a' => 'Choice A',
'b' => 'Choice B',
'c' => 'Choice C',
),
),
Usage: Nomad_Form_Fields::STATE
Select dropdown menu with US States as options. You can specify format
with full
(Alabama-Wyoming) or short
(AL-WY) format options. Default format: short
.
'example_state' => array(
'name' => 'example_state',
'label' => 'State Field',
'type' => Nomad_Form_Fields::STATE,
),
Usage: Nomad_Form_Fields::TEXT
Text input field
'example_text' => array(
'name' => 'example_text',
'label' => 'Text Field',
'type' => Nomad_Form_Fields::TEXT,
),
Usage: Nomad_Form_Fields::TEXTAREA
Textarea field.
'example_textarea' => array(
'name' => 'example_textarea',
'label' => 'Textarea Field',
'type' => Nomad_Form_Fields::TEXTAREA,
),
Usage: Nomad_Form_Fields::TIME
Time input field.
'example_time' => array(
'name' => 'example_time',
'label' => 'Time Field',
'type' => Nomad_Form_Fields::TIME,
),
Usage: Nomad_Form_Fields::TOGGLE
Styled checkbox toggle switch field.
'example_toggle' => array(
'name' => 'example_toggle',
'label' => 'Toggle Field',
'type' => Nomad_Form_Fields::TOGGLE,
),
Usage: Nomad_Form_Fields::TOGGLES
Styled checkboxes toggle switch fields.
'example_toggles' => array(
'name' => 'example_toggles',
'label' => 'Toggles Field',
'type' => Nomad_Form_Fields::TOGGLES,
'options' => array(
'a' => 'Choice A',
'b' => 'Choice B',
'c' => 'Choice C',
),
),
Usage: Nomad_Form_Fields::UPLOAD
File input field.
'example_upload' => array(
'name' => 'example_upload',
'label' => 'Upload Field',
'type' => Nomad_Form_Fields::UPLOAD,
),
Usage: Nomad_Form_Fields::URL
URL input field.
'example_url' => array(
'name' => 'example_url',
'label' => 'Url Field',
'type' => Nomad_Form_Fields::URL,
),
Usage: Nomad_Form_Fields::WEEKDAY
Select dropdown menu with days of the week as options. You can specify format
with full
(Monday-Sunday), short
(Mon-Sun), or lower
(monday-sunday) format options. Default format: lower
.
'example_weekday' => array(
'name' => 'example_weekday',
'label' => 'Weekday Field',
'type' => Nomad_Form_Fields::WEEKDAY,
),
Usage: Nomad_Form_Fields::YEAR
Select dropdown menu with the years 1900-current as options. You can specify the min
and max
to determine what years are available as options.
'example_year' => array(
'name' => 'example_year',
'label' => 'Year Field',
'type' => Nomad_Form_Fields::YEAR,
),
Usage: Nomad_Form_Fields::YES_NO_BUTTON_GROUP
Button group with predefined Yes and No options.
'example_yes_no_button_group' => array(
'name' => 'example_yes_no_button_group',
'label' => 'Yes No Button Group',
'type' => Nomad_Form_Fields::YES_NO_BUTTON_GROUP,
),
The field name nomad_form_id
is reserved because it is used to determine the form that is being submitted. This is how multiple Nomad Forms are allowed to be used on the same page and be able to distinguish between which one was submitted.
/**
* Fires when first initializing a Nomad Form.
*
* @since 1.0.0
*
* @param string $form_id The form ID being initialized.
* @param array $args The form arguments.
*/
do_action( 'nomad/forms/init', $this->form_id(), $args );
/**
* Fires when first initializing a specific Nomad Form.
*
* @since 1.0.0
*
* @param array $args The form arguments.
*/
do_action( "nomad/forms/{$this->form_id()}/init", $args );
/**
* Filter the form arguments.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param array $args The form arguments.
*/
$args = apply_filters( "nomad/forms/{$this->form_id()}/args", $args );
/**
* Filter the form fields.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param array $fields The form fields.
*/
$args['fields'] = apply_filters( "nomad/forms/{$this->form_id()}/fields", $args['fields'] );
/**
* Filter form injections.
*
* It's recommended to use the `nomad_form_injection()` function instead of the filter directly.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param array $injections Form injections.
*/
$injections = apply_filters( "nomad/forms/{$this->form_id()}/injections", array() );
/**
* Fires before the opening form tag.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/before_form_open', $this );
/**
* Fires before the opening form tag for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/before_form_open", $this );
/**
* Filters the opening form tag output.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param string $output The opening form tag output.
* @param Nomad_Form $this The form instance.
*/
$output = apply_filters( 'nomad/forms/form_open', $output, $this );
/**
* Filters the opening form tag output for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param string $output The opening form tag output.
* @param Nomad_Form $this The form instance.
*/
$output = apply_filters( "nomad/forms/{$this->form_id()}/form_open", $output, $this );
/**
* Fires after the opening form tag for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/after_open", $this );
/**
* Fires after the opening form tag.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/after_open', $this );
nomad/forms/hidden_fields
/**
* Fires just after the `nomad_form_nonce` field in order to output
* additional hidden fields.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/hidden_fields', $this );
nomad/forms/{$this->form_id()}/hidden_fields
/**
* Fires just after the `nomad_form_nonce` field in order to output
* additional hidden fields of a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/hidden_fields", $this );
/**
* Fires before the form fields container.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/before_fields_container', $this );
/**
* Fires before the form fields container for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/before_fields_container", $this );
/**
* Fires before the form fields.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/before_fields', $this );
/**
* Fires before the form fields for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/before_fields", $this );
/**
* Filters a specific form fields arguments.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param array $field The form field.
* @param Nomad_Form $this The form instance.
*/
$field = apply_filters( "nomad/forms/{$this->form_id()}/field/{$field['name']}/args", $field, $this );
/**
* Fires before a fields output.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
* @param mixed $field The field being output.
*/
do_action( "nomad/forms/{$this->form_id()}/field/before", $this, $field );
/**
* Fires before a fields output for a specific field.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
* @param mixed $field The field being output.
*/
do_action( "nomad/forms/{$this->form_id()}/field/{$field['name']}/before", $this, $field );
/**
* Fires after a fields output for a specific field.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
* @param mixed $field The field being output.
*/
do_action( "nomad/forms/{$this->form_id()}/field/{$field['name']}/after", $this, $field );
/**
* Fires after a fields output.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
* @param mixed $field The field being output.
*/
do_action( "nomad/forms/{$this->form_id()}/field/after", $this, $field );
/**
* Fires after the form fields for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/after_fields", $this );
/**
* Fires after the form fields.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/after_fields', $this );
/**
* Fires after the form fields container for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/after_fields_container", $this );
/**
* Fires before the form fields container.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/after_fields_container', $this );
/**
* Fires before the form actions.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/before_form_actions', $this );
/**
* Fires before the form actions for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/before_form_actions", $this );
/**
* Filters the submit button attributes.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param array $submit_attributes The submit button attributes.
* @param Nomad_Form $this The form instance.
*/
$submit_attributes = apply_filters( 'nomad/forms/submit_attributes', $submit_attributes, $this );
/**
* Filters the submit button attributes for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param array $submit_attributes The submit button attributes.
* @param Nomad_Form $this The form instance.
*/
$submit_attributes = apply_filters( "nomad/forms/{$this->form_id()}/submit_attributes", $submit_attributes, $this );
/**
* Fires before the submit button.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/before_submit_button', $this );
/**
* Fires before the submit button for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/before_submit_button", $this );
/**
* Fires after the submit button for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/after_submit_button", $this );
/**
* Fires after the submit button.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/after_submit_button', $this );
/**
* Fires after the form actions for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/after_form_actions", $this );
/**
* Fires after the form actions.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/after_form_actions', $this );
/**
* Filters the reset button attributes.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param array $reset_attributes The reset button attributes.
* @param Nomad_Form $this The form instance.
*/
$reset_attributes = apply_filters( 'nomad/forms/reset_attributes', $reset_attributes, $this );
/**
* Filters the reset button attributes for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param array $reset_attributes The reset button attributes.
* @param Nomad_Form $this The form instance.
*/
$reset_attributes = apply_filters( "nomad/forms/{$this->form_id()}/reset_attributes", $reset_attributes, $this );
/**
* Filters the cancel button attributes.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param array $cancel_attributes The cancel button attributes.
* @param Nomad_Form $this The form instance.
*/
$cancel_attributes = apply_filters( 'nomad/forms/cancel_attributes', $cancel_attributes, $this );
/**
* Filters the cancel button attributes for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param array $cancel_attributes The cancel button attributes.
* @param Nomad_Form $this The form instance.
*/
$cancel_attributes = apply_filters( "nomad/forms/{$this->form_id()}/cancel_attributes", $cancel_attributes, $this );
/**
* Filters the closing form tag output.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param string $output The closing form tag output.
* @param Nomad_Form $this The form instance.
*/
$output = apply_filters( 'nomad/forms/form_close', $output, $this );
/**
* Filters the closing form tag output for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param string $output The closing form tag output.
* @param Nomad_Form $this The form instance.
*/
$output = apply_filters( "nomad/forms/{$this->form_id()}/form_close", $output, $this );
/**
* Fires before the closing form tag for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/before_form_close", $this );
/**
* Fires before the closing form tag.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/before_form_close', $this );
/**
* Fires after the closing form tag for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/after_form_close", $this );
/**
* Fires after the closing form tag.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/after_form_close', $this );
/**
* Filters whether or not the form submission is valid.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param boolean $is_valid Whether or not the form submission is valid.
* @param Nomad_Form $this The form instance.
*/
$is_valid = apply_filters( "nomad/forms/{$this->form_id()}/is_valid", $is_valid, $this );
/**
* Fires when a specific form is submitted successfully.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/success", $this );
/**
* Fires when a specific form submission encounters an error.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/error", $this );
/**
* Fires every time a form is submitted, regardless of whether
* or not it was valid.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( 'nomad/forms/process', $this );
/**
* Fires every time a specific form is submitted regardless of
* whether or not it was valid.
*
* @since 1.0.0
*
* @param Nomad_Form $this The form instance.
*/
do_action( "nomad/forms/{$this->form_id()}/process", $this );
/**
* Filter the form submission success message for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param string $success_message The success message for the form.
*/
$success_message = apply_filters( "nomad/forms/{$this->form_id()}/success_message", $success_message );
/**
* Filter the form submission error message for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param string $error_message The error message for the form.
*/
$error_message = apply_filters( "nomad/forms/{$this->form_id()}/error_message", $error_message );
/**
* Filter the form submission error messages for a specific form.
*
* Can only be used if the form allows modifications.
*
* @since 1.0.0
*
* @param array $error_messages The error messages generated when validating form fields.
*/
$error_messages = apply_filters( "nomad/forms/{$this->form_id()}/error_messages", $this->messages );
- Initial Release
The MIT License (MIT). Please see License File for more information.
Copyright (c) 2021 Jake Sutherland