wpcf7_flamingo_get_value

The Contact Form 7 wpcf7 flamingo get value function.

Description

wpcf7_flamingo_get_value( $field, $contactform ); 

Parameters (2)

0. $field
The field.
1. $contactform
The contactform.

Usage

  1. if ( !function_exists( 'wpcf7_flamingo_get_value' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/modules/flamingo.php'; 
  3.  
  4. // The field. 
  5. $field = null; 
  6.  
  7. // The contactform. 
  8. $contactform = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wpcf7_flamingo_get_value($field, $contactform); 
  12.  

Defined (1)

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

/modules/flamingo.php  
  1. function wpcf7_flamingo_get_value( $field, $contactform ) { 
  2. if ( empty( $field ) || empty( $contactform ) ) { 
  3. return false; 
  4.  
  5. $value = ''; 
  6.  
  7. if ( in_array( $field, array( 'email', 'name', 'subject' ) ) ) { 
  8. $templates = $contactform->additional_setting( 'flamingo_' . $field ); 
  9.  
  10. if ( empty( $templates[0] ) ) { 
  11. $template = sprintf( '[your-%s]', $field ); 
  12. } else { 
  13. $template = trim( wpcf7_strip_quote( $templates[0] ) ); 
  14.  
  15. $value = wpcf7_mail_replace_tags( $template ); 
  16.  
  17. $value = apply_filters( 'wpcf7_flamingo_get_value', $value,  
  18. $field, $contactform ); 
  19.  
  20. return $value;