Ticket #42775: 42775.diff
File 42775.diff, 4.6 KB (added by , 4 years ago) |
---|
-
src/js/_enqueues/vendor/plupload/handlers.js
568 568 uploadStart(); 569 569 570 570 plupload.each( files, function( file ) { 571 572 if ( file.type === 'image/heic' && up.settings.heic_upload_error ) { 573 // Show error but do not block uploading. 574 wpQueueError( pluploadL10n.unsupported_image ) 575 } 576 571 577 fileQueued( file ); 572 578 }); 573 579 -
src/js/_enqueues/vendor/plupload/wp-plupload.js
351 351 return; 352 352 } 353 353 354 if ( file.type === 'image/heic' && up.settings.heic_upload_error ) { 355 // Show error but do not block uploading. 356 Uploader.errors.unshift({ 357 message: pluploadL10n.unsupported_image, 358 data: {}, 359 file: file 360 }); 361 } 362 354 363 // Generate attributes for a new `Attachment` model. 355 364 attributes = _.extend({ 356 365 file: file, -
src/wp-admin/includes/admin-filters.php
15 15 16 16 // Media hooks. 17 17 add_action( 'attachment_submitbox_misc_actions', 'attachment_submitbox_metadata' ); 18 add_filter( 'plupload_init', 'wp_show_heic_upload_error' ); 18 19 19 20 add_action( 'media_upload_image', 'wp_media_upload_handler' ); 20 21 add_action( 'media_upload_audio', 'wp_media_upload_handler' ); -
src/wp-includes/default-filters.php
534 534 add_action( 'wp_playlist_scripts', 'wp_playlist_scripts' ); 535 535 add_action( 'customize_controls_enqueue_scripts', 'wp_plupload_default_settings' ); 536 536 add_action( 'plugins_loaded', '_wp_add_additional_image_sizes', 0 ); 537 add_filter( 'plupload_default_settings', 'wp_show_heic_upload_error' ); 537 538 538 539 // Nav menu. 539 540 add_filter( 'nav_menu_item_id', '_nav_menu_item_id_use_once', 10, 2 ); -
src/wp-includes/functions.php
3046 3046 'bmp' => 'image/bmp', 3047 3047 'tiff|tif' => 'image/tiff', 3048 3048 'ico' => 'image/x-icon', 3049 'heic' => 'image/heic', 3049 3050 // Video formats. 3050 3051 'asf|asx' => 'video/x-ms-asf', 3051 3052 'wmv' => 'video/x-ms-wmv', -
src/wp-includes/media.php
3592 3592 * 3593 3593 * @param array $params Default Plupload parameters array. 3594 3594 */ 3595 $params = apply_filters( 'plupload_default_params', $params ); 3596 $params['_wpnonce'] = wp_create_nonce( 'media-form' ); 3595 $params = apply_filters( 'plupload_default_params', $params ); 3596 3597 $params['_wpnonce'] = wp_create_nonce( 'media-form' ); 3598 3597 3599 $defaults['multipart_params'] = $params; 3598 3600 3599 3601 $settings = array( … … 4679 4681 // 2x large size. 4680 4682 add_image_size( '2048x2048', 2048, 2048 ); 4681 4683 } 4684 4685 /** 4686 * Callback to enable showig of the user error when uploading .heic images. 4687 * 4688 * @since 5.5.0 4689 * 4690 * @param array[] $plupload_settings The settings for Plupload.js. 4691 * @return array[] Modified settings for Plupload.js. 4692 */ 4693 function wp_show_heic_upload_error( $plupload_settings ) { 4694 $plupload_settings['heic_upload_error'] = true; 4695 return $plupload_settings; 4696 } -
src/wp-includes/script-loader.php
867 867 'deleted' => __( 'moved to the Trash.' ), 868 868 /* translators: %s: File name. */ 869 869 'error_uploading' => __( '“%s” has failed to upload.' ), 870 'unsupported_image' => __( 'This image cannot be displayed in a web browser. For best results convert it to JPEG before uploading.' ), 870 871 ); 871 872 872 873 $scripts->add( 'moxiejs', "/wp-includes/js/plupload/moxie$suffix.js", array(), '1.3.5' );