caldera_forms_file_upload_handler

Filter the callback function for file uploads.

Description

apply_filters( 'caldera_forms_file_upload_handler', (callback) $array, (array) $form, (array) $field ); 

Parameters (3)

0. $array (callback) => array( 'Caldera_Forms_Files', 'upload' )
The array.
1. $form (array)
Form config
2. $field (array)
Field config

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'caldera_forms_file_upload_handler', $array, $form, $field ); 
  2.  
  3. if ( !empty( $array ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the caldera_forms_file_upload_handler callback 
  2. function filter_caldera_forms_file_upload_handler( $array, $form, $field ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'caldera_forms_file_upload_handler', 'filter_caldera_forms_file_upload_handler', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'caldera_forms_file_upload_handler', 'filter_caldera_forms_file_upload_handler', 10, 3 ); 

Defined (1)

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

/classes/files.php  
  1. return apply_filters( 'caldera_forms_file_upload_handler', array( 'Caldera_Forms_Files', 'upload' ), $form, $field );