mc4wp_form_get_response_html

The MailChimp for WordPress Lite mc4wp form get response html function.

Description

(string) mc4wp_form_get_response_html( (int) $form_id = 0 ); 

Returns (string)

Parameters (1)

0. $form_id — Optional. (int)
The form id.

Usage

  1. if ( !function_exists( 'mc4wp_form_get_response_html' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'mailchimp-for-wordpress-lite/includes/functions/general.php'; 
  3.  
  4. // The form id. 
  5. $form_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = mc4wp_form_get_response_html($form_id); 
  9.  

Defined (1)

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

/includes/functions/general.php  
  1. function mc4wp_form_get_response_html( $form_id = 0 ) { 
  2. $form = MC4WP_Form::get(); 
  3.  
  4. // return empty string if form isn't submitted. 
  5. if( ! $form instanceof MC4WP_Form || ! $form->is_submitted() ) { 
  6. return ''; 
  7.  
  8. return $form->request->get_response_html();