mc4wp_form_is_submitted

Check whether a form was submitted.

Description

(boolean) mc4wp_form_is_submitted( (int) $form_id = 0, (null) $element_id = null ); 

Returns (boolean)

Parameters (2)

0. $form_id — Optional. (int)
The ID of the form you want to check. (optional)
1. $element_id — Optional. (null) => null
The ID of the form element you want to check, eg id="mc4wp-form-1" (optional)

Usage

  1. if ( !function_exists( 'mc4wp_form_is_submitted' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'mailchimp-for-wordpress-lite/includes/functions/general.php'; 
  3.  
  4. // The ID of the form you want to check. (optional) 
  5. $form_id = -1; 
  6.  
  7. // The ID of the form element you want to check, eg id="mc4wp-form-1" (optional) 
  8. $element_id = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = mc4wp_form_is_submitted($form_id, $element_id); 
  12.  

Defined (1)

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

/includes/functions/general.php  
  1. function mc4wp_form_is_submitted( $form_id = 0, $element_id = null ) { 
  2. $form = MC4WP_Form::get(); 
  3.  
  4. if( ! $form instanceof MC4WP_Form ) { 
  5. return false; 
  6.  
  7. return $form->is_submitted( $element_id );