WordPress как на ладони
Очень Удобный и Быстрый Хостинг для сайтов на WordPress. Пользуюсь сам и вам рекомендую!
функция не описана

ACF_Media::handle_upload_prefilter() public ACF 5.1.5

Filters data for the current file being uploaded.

{} Это метод класса: ACF_Media{}

Возвращает

Массив.

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

$ACF_Media = new ACF_Media();
$ACF_Media->handle_upload_prefilter( $file );
$file(массив) (обязательный)
An array of data for a single file.

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

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

Код ACF_Media::handle_upload_prefilter() ACF 5.10.2

public function handle_upload_prefilter( $file ) {
	$field = $this->get_source_field();
	if ( ! $field ) {
		return $file;
	}

	// Validate the attachment and append any errors.
	$errors = acf_validate_attachment( $file, $field, 'upload' );

	/**
	 * Filters the errors for a file before it is uploaded to WordPress.
	 *
	 * @date    16/02/2015
	 * @since   5.1.5
	 *
	 * @param   array $errors An array of errors.
	 * @param   array $file An array of data for a single file.
	 * @param   array $field The field array.
	 */
	$errors = apply_filters( "acf/upload_prefilter/type={$field['type']}", $errors, $file, $field );
	$errors = apply_filters( "acf/upload_prefilter/name={$field['_name']}", $errors, $file, $field );
	$errors = apply_filters( "acf/upload_prefilter/key={$field['key']}", $errors, $file, $field );
	$errors = apply_filters( 'acf/upload_prefilter', $errors, $file, $field );

	// Append errors.
	if ( ! empty( $errors ) ) {
		$file['error'] = implode( "\n", $errors );
	}

	// Ensure newly uploaded image contains "preview_size" within the "size" data.
	add_filter( 'image_size_names_choose', array( $this, 'image_size_names_choose' ), 10, 1 );

	// Return.
	return $file;
}