acf/upload_prefilter/key=(key) хук-фильтр . ACF 5.1.5
Filters the errors for a file before it is uploaded to WordPress.
Использование
add_filter( 'acf/upload_prefilter/key=(key)', 'filter_function_name_4542', 10, 3 ); function filter_function_name_4542( $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/upload_prefilter/key=(key)
acf/includes/media.php 115
$errors = apply_filters( "acf/upload_prefilter/key={$field['key']}", $errors, $file, $field );