cf_custom_fields_filter_upload_handler

Use custom handler for featured image.

Description

(string) cf_custom_fields_filter_upload_handler( (array|string|callable) $handler, (array) $form, (array) $field ); 

Returns (string)

Parameters (3)

0. $handler (array|string|callable)
The handler.
1. $form (array)
Form config
2. $field (array)
Field config

Usage

  1. if ( !function_exists( 'cf_custom_fields_filter_upload_handler' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'caldera-custom-fields/includes/to-post-type.php'; 
  3.  
  4. // The handler. 
  5. $handler = null; 
  6.  
  7. // Form config 
  8. $form = array(); 
  9.  
  10. // Field config 
  11. $field = array(); 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = cf_custom_fields_filter_upload_handler($handler, $form, $field); 
  15.  

Defined (1)

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

/includes/to-post-type.php  
  1. function cf_custom_fields_filter_upload_handler( $handler, $form, $field ) { 
  2. if( cf_custom_fields_is_featured_image_field( $field, $form ) ) { 
  3.  
  4. return $handler; 
  5.