ninja_forms_field_desc_display

The Ninja Forms ninja forms field desc display function.

Description

ninja_forms_field_desc_display( $field_id, $data, (string) $form_id = '' ); 

Parameters (3)

0. $field_id
The field id.
1. $data
The data.
2. $form_id — Optional. (string) => ''
The form id.

Usage

  1. if ( !function_exists( 'ninja_forms_field_desc_display' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/fields/desc.php'; 
  3.  
  4. // The field id. 
  5. $field_id = null; 
  6.  
  7. // The data. 
  8. $data = null; 
  9.  
  10. // The form id. 
  11. $form_id = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = ninja_forms_field_desc_display($field_id, $data, $form_id); 
  15.  

Defined (1)

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

/deprecated/includes/fields/desc.php  
  1. function ninja_forms_field_desc_display( $field_id, $data, $form_id = '' ) { 
  2.  
  3. if(isset($data['desc_el'])) { 
  4. $desc_el = $data['desc_el']; 
  5. }else{ 
  6. $desc_el = "p"; 
  7.  
  8. if(isset($data['default_value'])) { 
  9. $default_value = $data['default_value']; 
  10. }else{ 
  11. $default_value = ''; 
  12.  
  13. $default_value = html_entity_decode( $default_value, ENT_COMPAT, "UTF-8" ); 
  14.  
  15. if($desc_el == "div") { 
  16. $default_value = wpautop( $default_value );  
  17. }else{  
  18. $default_value = nl2br( $default_value ); 
  19.  
  20. if( isset( $data['display_style'] ) ) { 
  21. $display_style = $data['display_style']; 
  22. }else{ 
  23. $display_style = ''; 
  24. $default_value = do_shortcode( $default_value ); 
  25. $field_class = ninja_forms_get_field_class( $field_id, $form_id ); 
  26. $field_class .= ' nf-desc'; 
  27. ?> 
  28. <<?php echo $desc_el;?> class="<?php echo $field_class;?>" id="ninja_forms_field_<?php echo $field_id;?>_div_wrap" style="<?php echo $display_style;?>" rel="<?php echo $field_id;?>"><?php echo $default_value;?></<?php echo $desc_el;?>> 
  29. <?php