WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/03/2020 11:13:30 PM (13 months ago)
Author:
azaozz
Message:

Media: Show an error message when a .heic file is uploaded that this type of files cannot be displayed in a web browser and suggesting to convert to JPEG. The message is shown by using filters, plugins that want to handle uploading of .heic files can remove it.

Props mattheweppelsheimer, mikeschroder, jeffr0, andraganescu, desrosj, azaozz.
Fixes #42775.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r48275 r48288  
    36003600     * @param array $params Default Plupload parameters array.
    36013601     */
    3602     $params                       = apply_filters( 'plupload_default_params', $params );
    3603     $params['_wpnonce']           = wp_create_nonce( 'media-form' );
     3602    $params = apply_filters( 'plupload_default_params', $params );
     3603
     3604    $params['_wpnonce'] = wp_create_nonce( 'media-form' );
     3605
    36043606    $defaults['multipart_params'] = $params;
    36053607
     
    46874689    add_image_size( '2048x2048', 2048, 2048 );
    46884690}
     4691
     4692/**
     4693 * Callback to enable showig of the user error when uploading .heic images.
     4694 *
     4695 * @since 5.5.0
     4696 *
     4697 * @param array[] $plupload_settings The settings for Plupload.js.
     4698 * @return array[] Modified settings for Plupload.js.
     4699 */
     4700function wp_show_heic_upload_error( $plupload_settings ) {
     4701    $plupload_settings['heic_upload_error'] = true;
     4702    return $plupload_settings;
     4703}
Note: See TracChangeset for help on using the changeset viewer.