cmb2_valid_img_types

Which image types are considered valid image file extensions.

Description

apply_filters( 'cmb2_valid_img_types', (array) $valid_types ); 

Parameters (1)

0. $valid_types (array)
The valid image file extensions.

Usage

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

Defined (3)

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

/vendor/wordimpress/maps-builder-core/includes/libraries/metabox/includes/types/CMB2_Type_File_Base.php  
  1. $is_valid_types = apply_filters( 'cmb2_valid_img_types', $valid_types ); 
/includes/libraries/metabox/tests/test-cmb-types.php  
  1. $valid_types = apply_filters( 'cmb2_valid_img_types', array( 'jpg', 'jpeg', 'png', 'gif', 'ico', 'icon' ) ); 
/includes/libraries/metabox/includes/CMB2_Types.php  
  1. $is_valid_types = (array) apply_filters( 'cmb2_valid_img_types', array( 'jpg', 'jpeg', 'png', 'gif', 'ico', 'icon' ) );