wp_show_heic_upload_error()WP 5.5.0

Callback to enable showing of the user error when uploading .heic images.

Хуков нет.

Возвращает

Массив[]. Modified settings for Plupload.js.

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

wp_show_heic_upload_error( $plupload_settings );
$plupload_settings(array[]) (обязательный)
The settings for Plupload.js.

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

С версии 5.5.0 Введена.
С версии 6.7.0 The default behavior is to enable heic uploads as long as the server supports the format. The uploads are converted to JPEG's by default.

Код wp_show_heic_upload_error() WP 6.8

function wp_show_heic_upload_error( $plupload_settings ) {
	// Check if HEIC images can be edited.
	if ( ! wp_image_editor_supports( array( 'mime_type' => 'image/heic' ) ) ) {
		$plupload_init['heic_upload_error'] = true;
	}
	return $plupload_settings;
}