mc4wp_form_action
Filters the `action` attribute of the `
Description
Defaults to null,, which means no action attribute will be printed.
Parameters (2)
- 0. $form_action_attribute (string)
- The form action attribute.
- 1. $form (MC4WP_Form)
- The form.
Usage
- To run the hook, copy the example below.
- $form_action_attribute = apply_filters( 'mc4wp_form_action', $form_action_attribute, $form );
- if ( !empty( $form_action_attribute ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the mc4wp_form_action callback
- function filter_mc4wp_form_action( $form_action_attribute, $form ) {
- // make filter magic happen here...
- return $form_action_attribute;
- };
- // add the filter
- add_filter( 'mc4wp_form_action', 'filter_mc4wp_form_action', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'mc4wp_form_action', 'filter_mc4wp_form_action', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /includes/forms/class-form-element.php
- $form_action_attribute = apply_filters( 'mc4wp_form_action', $form_action_attribute, $form );