grunion_contact_form_field_html_filter

Filter the HTML of the Contact Form and output the one requested by language.

Description

grunion_contact_form_field_html_filter( $r, $field_label, $id ); 

Parameters (3)

0. $r
The r.
1. $field_label
The field label.
2. $id
The id.

Usage

  1. if ( !function_exists( 'grunion_contact_form_field_html_filter' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/3rd-party/wpml.php'; 
  3.  
  4. // The r. 
  5. $r = null; 
  6.  
  7. // The field label. 
  8. $field_label = null; 
  9.  
  10. // The id. 
  11. $id = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = grunion_contact_form_field_html_filter($r, $field_label, $id); 
  15.  

Defined (1)

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

/3rd-party/wpml.php  
  1. function grunion_contact_form_field_html_filter( $r, $field_label, $id ) { 
  2. global $sitepress; 
  3.  
  4. if ( function_exists( 'icl_translate' ) ) { 
  5. if ( $sitepress->get_current_language() !== $sitepress->get_default_language() ) { 
  6. $label_translation = icl_translate( jetpack', $field_label . '_label', $field_label ); 
  7. $r = str_replace( $field_label, $label_translation, $r ); 
  8.  
  9. return $r;