ninja_forms_display_field_type

The Ninja Forms ninja forms display field type function.

Description

ninja_forms_display_field_type( $field_id, $data ); 

Parameters (2)

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

Usage

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

Defined (1)

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

/deprecated/includes/display/fields/field-type.php  
  1. function ninja_forms_display_field_type( $field_id, $data ) { 
  2. global $ninja_forms_loading, $ninja_forms_processing; 
  3.  
  4. $field = ninja_forms_get_field_by_id( $field_id ); 
  5. $form_id = $field['form_id']; 
  6.  
  7. if ( isset ( $ninja_forms_loading ) && $ninja_forms_loading->get_form_ID() == $form_id ) { 
  8. $field_row = $ninja_forms_loading->get_field_settings( $field_id ); 
  9. } else if ( isset ( $ninja_forms_processing ) && $ninja_forms_processing->get_form_ID() == $form_id ) { 
  10. $field_row = $ninja_forms_processing->get_field_settings( $field_id ); 
  11.  
  12. $field_type = $field_row['type']; 
  13. if ( strpos( $field_type, '_' ) === 0 ) { 
  14. $field_type = substr( $field_type, 1 ); 
  15. $field_type = apply_filters( 'ninja_forms_display_field_type', $field_type, $field_id ); 
  16. ?> 
  17. <input type="hidden" id="ninja_forms_field_<?php echo $field_id;?>_type" value="<?php echo $field_type;?>"> 
  18. <?php