grunion_contact_form_form_action

Filter the contact form action URL.

Description

apply_filters( 'grunion_contact_form_form_action', (string) $url_contact_form_id, $globals_post, (int) $id ); 

Parameters (3)

0. $url_contact_form_id (string) => "{$url}#contact-form-{$id}"
The url contact form id.
1. $globals_post
$globals post post global variable.
2. $id (int)
Contact Form ID.

Usage

To run the hook, copy the example below.
  1. $url_contact_form_id = apply_filters( 'grunion_contact_form_form_action', $url_contact_form_id, $globals_post, $id ); 
  2.  
  3. if ( !empty( $url_contact_form_id ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the grunion_contact_form_form_action callback 
  2. function filter_grunion_contact_form_form_action( $url_contact_form_id, $globals_post, $id ) { 
  3. // make filter magic happen here... 
  4. return $url_contact_form_id
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'grunion_contact_form_form_action', 'filter_grunion_contact_form_form_action', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'grunion_contact_form_form_action', 'filter_grunion_contact_form_form_action', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/modules/contact-form/grunion-contact-form.php  
  1. $url = apply_filters( 'grunion_contact_form_form_action', "{$url}#contact-form-{$id}", $GLOBALS['post'], $id );