acf/validate_is_image_attachment/error_message filter-hookACF 6.8.7

Filters the error message used when an attachment is not a valid image.

Usage

add_filter( 'acf/validate_is_image_attachment/error_message', 'wp_kama_acf_validate_is_image_attachment_error_message_filter', 10, 5 );

/**
 * Function for `acf/validate_is_image_attachment/error_message` filter-hook.
 * 
 * @param string $error_message The default error message.
 * @param array  $field         The field array.
 * @param string $context       The current context (uploading, preparing, basic_upload).
 * @param array  $file          An array of data for a single file.
 * @param array  $attachment    An array of attachment data which differs based on the context.
 *
 * @return string
 */
function wp_kama_acf_validate_is_image_attachment_error_message_filter( $error_message, $field, $context, $file, $attachment ){
	// filter...
	return $error_message;
}
$error_message(string)
The default error message.
$field(array)
The field array.
$context(string)
The current context (uploading, preparing, basic_upload).
$file(array)
An array of data for a single file.
$attachment(array)
An array of attachment data which differs based on the context.

Changelog

Since 6.8.7 Introduced.

Where the hook is called

acf_validate_is_image_attachment()
acf/validate_is_image_attachment/error_message
acf/includes/api/api-helpers.php 3306
$error_message = apply_filters( 'acf/validate_is_image_attachment/error_message', __( 'File must be a valid image.', 'acf' ), $field, $context, $file, $attachment );

Where the hook is used in Advanced Custom Fields PRO

Usage not found.