FWSMC_create_subform

The MailChimp Subscription Plus FWSMC create subform function.

Description

FWSMC_create_subform( (constant) $atts = null ); 

Parameters (1)

0. $atts — Optional. (constant) => null
The atts.

Usage

  1. if ( !function_exists( 'FWSMC_create_subform' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'mailchimp-subscription-plus/mailchimp-subscription-plus.php'; 
  3.  
  4. // The atts. 
  5. $atts = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = FWSMC_create_subform($atts); 
  9.  

Defined (1)

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

/mailchimp-subscription-plus.php  
  1. function FWSMC_create_subform($atts = null) { 
  2.  
  3. $atts = shortcode_atts( 
  4. array( 
  5. 'extramergefield' => get_option('fwsmc-extraMergeFieldValue') 
  6. ),  
  7. $atts 
  8. ); 
  9.  
  10. return '<h3>'.__( 'Subscribe now!', 'fws-mailchimp-subscribe' ).'</h3> 
  11. <p>'.__( 'Subscribe today and get future blog posts your email.', 'fws-mailchimp-subscribe' ).'</p> 
  12. <form id="fws-subscribeform" role="form" class="form-inline"> 
  13. <div class="form-group"> 
  14. <label class="sr-only" for="firstname">'.__( 'Your first name', 'fws-mailchimp-subscribe' ).'</label> 
  15. <input type="text" class="form-control defaultText" title="'.__( 'Your first name', 'fws-mailchimp-subscribe' ).'" name="name" tabindex="1" /> 
  16. </div> 
  17. <div class="form-group"> 
  18. <label class="sr-only" for="emailaddress">'.__( 'Your email address', 'fws-mailchimp-subscribe' ).'</label> 
  19. <input type="email" class="form-control defaultText" title="'.__( 'Your email address', 'fws-mailchimp-subscribe' ).'" name="email" tabindex="2" /> 
  20. </div> 
  21. '.wp_nonce_field('fwsmc_subform', '_fwsmc_subnonce', true, false).' 
  22. <input type="hidden" name="action" value="subscribeform_action" /> 
  23. <input type="hidden" name="extramergefield" value="'.esc_attr($atts['extramergefield']).'" /> 
  24. <button class="btn btn-primary btn-sm send-subscr-fws" tabindex="3" type="button">'.__( 'Subscribe', 'fws-mailchimp-subscribe' ).'</button> 
  25. </form> 
  26. <div id="fws-subscribeform-msg" class="error-message"></div> 
  27. ';