wpcf7_submit_form_tag_handler

The Contact Form 7 wpcf7 submit form tag handler function.

Description

wpcf7_submit_form_tag_handler( $tag ); 

Parameters (1)

0. $tag
The tag.

Usage

  1. if ( !function_exists( 'wpcf7_submit_form_tag_handler' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/modules/submit.php'; 
  3.  
  4. // The tag. 
  5. $tag = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wpcf7_submit_form_tag_handler($tag); 
  9.  

Defined (1)

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

/modules/submit.php  
  1. function wpcf7_submit_form_tag_handler( $tag ) { 
  2. $tag = new WPCF7_FormTag( $tag ); 
  3.  
  4. $class = wpcf7_form_controls_class( $tag->type ); 
  5.  
  6. $atts = array(); 
  7.  
  8. $atts['class'] = $tag->get_class_option( $class ); 
  9. $atts['id'] = $tag->get_id_option(); 
  10. $atts['tabindex'] = $tag->get_option( 'tabindex', 'int', true ); 
  11.  
  12. $value = isset( $tag->values[0] ) ? $tag->values[0] : ''; 
  13.  
  14. if ( empty( $value ) ) { 
  15. $value = __( 'Send', 'contact-form-7' ); 
  16.  
  17. $atts['type'] = 'submit'; 
  18. $atts['value'] = $value; 
  19.  
  20. $atts = wpcf7_format_atts( $atts ); 
  21.  
  22. $html = sprintf( '<input %1$s />', $atts ); 
  23.  
  24. return $html;