acf/upload_prefilter/type=(type)
Filters errors для файлу перед тим, як він uploaded до WordPress.
Використання
add_filter( 'acf/upload_prefilter/type=(type)', 'wp_kama_acf_upload_prefilter_type_filter', 10, 3); /** * Function for `acf/upload_prefilter/type=(type)` filter-hook. * * @param array $errors An array of errors. * @param array $file На array of data for a single file. * @param array $field The field array. * * @return array */ function wp_kama_acf_upload_prefilter_type_filter( $errors, $file, $field ){ // Filter... return $errors; }
-
$errors
(масив) - An array of errors.
-
$file
(масив) - На array of data for single file.
-
$field
(масив) - field array.
список змін
З версії 5.1.5 | Введено. |
Де викликається хук
acf/upload_prefilter/type=(type)
acf/includes/media.php 110
$errors = apply_filters( "acf/upload_prefilter/type={$field['type']}", $errors, $file, $field );
Де використовується хук в Advanced Custom Fields
Використання не знайдено.