caldera_forms_field_attributes

Create (with escaping) a field attributes string for a Caldera Forms field input.

Description

(string) caldera_forms_field_attributes( (array) array $attrs, (array) array $field, (array) array $form ); 

Returns (string)

Parameters (3)

0. $attrs (array) => array $attrs
Array of attributes, $name => $value
1. $field (array) => array $field
Field config
2. $form (array) => array $form
Form config

Usage

  1. if ( !function_exists( 'caldera_forms_field_attributes' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'caldera-forms/includes/functions.php'; 
  3.  
  4. // Array of attributes, $name => $value 
  5. $attrs = array(); 
  6.  
  7. // Field config 
  8. $field = array(); 
  9.  
  10. // Form config 
  11. $form = array(); 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = caldera_forms_field_attributes($attrs, $field, $form); 
  15.  

Defined (1)

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

/includes/functions.php  
  1. function caldera_forms_field_attributes( array $attrs, array $field, array $form ) { 
  2. $field_type = Caldera_Forms_Field_Util::get_type( $field, $form ); 
  3.  
  4. /** 
  5. * Filter field attributes before rendering 
  6. * @since 1.5.0 
  7. * @param array $attrs Array of attributes, $name => $value 
  8. * @param array $field Field config 
  9. * @param array $form Form config 
  10. */ 
  11. $attrs = apply_filters( 'caldera_forms_field_attributes', $attrs, $field, $form ); 
  12.  
  13. /** 
  14. * Filter field attributes before rendering for a specific field type 
  15. * @since 1.5.0 
  16. * @param array $attrs Array of attributes, $name => $value 
  17. * @param array $field Field config 
  18. * @param array $form Form config 
  19. */ 
  20. $attrs = apply_filters( "caldera_forms_field_attributes-$field_type", $attrs, $form ); 
  21.  
  22.  
  23.  
  24.