wp_show_heic_upload_error( array[] $plupload_settings ): array[]

In this article

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

Parameters

$plupload_settingsarray[]required
The settings for Plupload.js.

Return

array[] Modified settings for Plupload.js.

Source

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;
}

Changelog

VersionDescription
6.7.0The default behavior is to enable heic uploads as long as the server supports the format. The uploads are converted to JPEG’s by default.
5.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.