ninja_forms_field_textarea_display

The Ninja Forms ninja forms field textarea display function.

Description

ninja_forms_field_textarea_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_textarea_display' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/fields/textarea.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_textarea_display($field_id, $data, $form_id); 
  15.  

Defined (1)

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

/deprecated/includes/fields/textarea.php  
  1. function ninja_forms_field_textarea_display( $field_id, $data, $form_id = '' ) { 
  2. if(isset($data['default_value'])) { 
  3. $default_value = $data['default_value']; 
  4. }else{ 
  5. $default_value = ''; 
  6.  
  7. $default_value = htmlspecialchars_decode( $default_value ); 
  8.  
  9. if(isset($data['textarea_rte'])) { 
  10. $textarea_rte = $data['textarea_rte']; 
  11. }else{ 
  12. $textarea_rte = 0; 
  13.  
  14. if( isset ( $data['textarea_media'] ) AND $data['textarea_media'] == 1 ) { 
  15. $textarea_media = true; 
  16. }else{ 
  17. $textarea_media = false; 
  18.  
  19. if ( isset( $data['disable_rte_mobile'] ) AND 1 == $data['disable_rte_mobile'] AND wp_is_mobile() ) { 
  20. $textarea_rte = 0; 
  21.  
  22. if( isset( $data['input_limit'] ) ) { 
  23. $input_limit = $data['input_limit']; 
  24. }else{ 
  25. $input_limit = ''; 
  26.  
  27. if( isset( $data['input_limit_type'] ) ) { 
  28. $input_limit_type = $data['input_limit_type']; 
  29. }else{ 
  30. $input_limit_type = ''; 
  31.  
  32. if( isset( $data['input_limit_msg'] ) ) { 
  33. $input_limit_msg = $data['input_limit_msg']; 
  34. }else{ 
  35. $input_limit_msg = ''; 
  36.  
  37. $field_class = ninja_forms_get_field_class( $field_id, $form_id ); 
  38.  
  39. $default_value = filter_var( $default_value, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES ); 
  40. $default_value = filter_var( $default_value, FILTER_SANITIZE_SPECIAL_CHARS ); 
  41.  
  42. if($textarea_rte == 1) { 
  43. $settings = array( 'media_buttons' => $textarea_media ); 
  44. $args = apply_filters( 'ninja_forms_textarea_rte', $settings ); 
  45. wp_editor( $default_value, 'ninja_forms_field_'.$field_id, $args ); 
  46. }else{ 
  47. ?> 
  48. <textarea name="ninja_forms_field_<?php echo $field_id;?>" id="ninja_forms_field_<?php echo $field_id;?>" class="<?php echo $field_class;?>" rel="<?php echo $field_id;?>" data-input-limit="<?php echo $input_limit;?>" data-input-limit-type="<?php echo $input_limit_type;?>" data-input-limit-msg="<?php echo $input_limit_msg;?>"><?php echo $default_value;?></textarea> 
  49. <?php