ninja_forms_display_field_processing_error

The Ninja Forms ninja forms display field processing error function.

Description

ninja_forms_display_field_processing_error( $field_id ); 

Parameters (1)

0. $field_id
The field id.

Usage

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

Defined (1)

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

/deprecated/includes/display/fields/field-error-message.php  
  1. function ninja_forms_display_field_processing_error( $field_id ) { 
  2. global $ninja_forms_processing; 
  3.  
  4. if( is_object( $ninja_forms_processing)) { 
  5.  
  6. $field_errors = $ninja_forms_processing->get_errors_by_location($field_id); 
  7. if ( $field_errors ) { 
  8. $style = ''; 
  9. } else { 
  10. $style = 'display:none;'; 
  11.  
  12. }else{ 
  13. $field_errors = ''; 
  14. $style = 'display:none;'; 
  15.  
  16. $class = apply_filters( 'ninja_forms_display_field_processing_error_class', 'ninja-forms-field-error', $field_id ); 
  17.  
  18. ?> 
  19. <div id="ninja_forms_field_<?php echo $field_id;?>_error" style="<?php echo $style;?>" class="<?php echo $class; ?>"> 
  20. <?php 
  21. if(is_array($field_errors)) { 
  22. foreach($field_errors as $error) { 
  23. echo '<p>'.$error['msg'].'</p>'; 
  24. ?> 
  25. </div> 
  26. <?php