acf/is_image_field
Filters whether the supplied field should be treated as an image field.
Usage
add_filter( 'acf/is_image_field', 'wp_kama_acf_is_image_field_filter', 10, 2 );
/**
* Function for `acf/is_image_field` filter-hook.
*
* @param bool $is_image_field Whether the field only accepts image uploads.
* @param array $field The field array.
*
* @return bool
*/
function wp_kama_acf_is_image_field_filter( $is_image_field, $field ){
// filter...
return $is_image_field;
}
- $is_image_field(true|false)
- Whether the field only accepts image uploads.
- $field(array)
- The field array.
Changelog
| Since 6.8.7 | Introduced. |
Where the hook is called
acf/is_image_field
acf/includes/api/api-helpers.php 3056
return (bool) apply_filters( 'acf/is_image_field', false, $field );
acf/includes/api/api-helpers.php 3076
$is_image_field = apply_filters( 'acf/is_image_field', $is_image_field, $field );