ninja_forms_edit_field_help

The Ninja Forms ninja forms edit field help function.

Description

ninja_forms_edit_field_help( $field_id, $field_data ); 

Parameters (2)

0. $field_id
The field id.
1. $field_data
The field data.

Usage

  1. if ( !function_exists( 'ninja_forms_edit_field_help' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/admin/edit-field/help.php'; 
  3.  
  4. // The field id. 
  5. $field_id = null; 
  6.  
  7. // The field data. 
  8. $field_data = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = ninja_forms_edit_field_help($field_id, $field_data); 
  12.  

Defined (1)

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

/deprecated/includes/admin/edit-field/help.php  
  1. function ninja_forms_edit_field_help( $field_id, $field_data ) { 
  2. global $ninja_forms_fields; 
  3. $field_row = ninja_forms_get_field_by_id($field_id); 
  4. $field_type = $field_row['type']; 
  5. $reg_field = $ninja_forms_fields[$field_type]; 
  6. $edit_help = $reg_field['edit_help']; 
  7. if($edit_help) { 
  8. if(isset($field_data['help_text'])) { 
  9. $help_text = $field_data['help_text']; 
  10. }else{ 
  11. $help_text = ''; 
  12.  
  13. if(isset($field_data['show_help'])) { 
  14. $show_help = $field_data['show_help']; 
  15. }else{ 
  16. $show_help = ''; 
  17.  
  18. if( $show_help == 1 ) { 
  19. $display_span = ''; 
  20. }else{ 
  21. $display_span = 'display:none;'; 
  22.  
  23. $help_desc = sprintf( __( 'If "help text" is enabled, there will be a question mark %s placed next to the input field. Hovering over this question mark will show the help text.', 'ninja-forms' ), '<img src="'.NINJA_FORMS_URL.'images/question-ico.gif">') ; 
  24. ninja_forms_edit_field_el_output($field_id, 'checkbox', __( 'Show Help Text', 'ninja-forms' ), 'show_help', $show_help, 'wide', '', 'ninja-forms-show-help'); 
  25. ?> 
  26. <span id="ninja_forms_field_<?php echo $field_id;?>_help_span" style="<?php echo $display_span;?>"> 
  27. <?php 
  28. ninja_forms_edit_field_el_output($field_id, 'textarea', __( 'Help Text', 'ninja-forms' ), 'help_text', $help_text, 'wide', '', 'widefat'); 
  29. ninja_forms_edit_field_el_output($field_id, 'desc', $help_desc, 'help_desc'); 
  30. ?> 
  31. </span> 
  32. <?php