acf/upload_prefilter/name=(name) хук-фильтрACF 5.1.5

Filters the errors for a file before it is uploaded to WordPress.

Использование

add_filter( 'acf/upload_prefilter/name=(name)', 'wp_kama_acf_upload_prefilter_name_filter', 10, 3 );

/**
 * Function for `acf/upload_prefilter/name=(name)` filter-hook.
 * 
 * @param array $errors An array of errors.
 * @param array $file   An array of data for a single file.
 * @param array $field  The field array.
 *
 * @return array
 */
function wp_kama_acf_upload_prefilter_name_filter( $errors, $file, $field ){

	// filter...
	return $errors;
}
$errors(массив)
An array of errors.
$file(массив)
An array of data for a single file.
$field(массив)
The field array.

Список изменений

С версии 5.1.5 Введена.

Где вызывается хук

ACF_Media::handle_upload_prefilter()
acf/upload_prefilter/name=(name)
acf/includes/media.php 111
$errors = apply_filters( "acf/upload_prefilter/name={$field['_name']}", $errors, $file, $field );

Где используется хук в Advanced Custom Fields PRO

Использование не найдено.