Changeset 48288
- Timestamp:
- 07/03/2020 11:13:30 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/vendor/plupload/handlers.js
r48168 r48288 569 569 570 570 plupload.each( files, function( file ) { 571 if ( file.type === 'image/heic' && up.settings.heic_upload_error ) { 572 // Show error but do not block uploading. 573 wpQueueError( pluploadL10n.unsupported_image ) 574 } 575 571 576 fileQueued( file ); 572 577 }); -
trunk/src/js/_enqueues/vendor/plupload/wp-plupload.js
r48110 r48288 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({ -
trunk/src/wp-admin/includes/admin-filters.php
r48121 r48288 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' ); -
trunk/src/wp-includes/default-filters.php
r48189 r48288 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. -
trunk/src/wp-includes/functions.php
r48205 r48288 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', -
trunk/src/wp-includes/media.php
r48275 r48288 3600 3600 * @param array $params Default Plupload parameters array. 3601 3601 */ 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 3604 3606 $defaults['multipart_params'] = $params; 3605 3607 … … 4687 4689 add_image_size( '2048x2048', 2048, 2048 ); 4688 4690 } 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 */ 4700 function wp_show_heic_upload_error( $plupload_settings ) { 4701 $plupload_settings['heic_upload_error'] = true; 4702 return $plupload_settings; 4703 } -
trunk/src/wp-includes/script-loader.php
r48285 r48288 847 847 /* translators: %s: File name. */ 848 848 'error_uploading' => __( '“%s” has failed to upload.' ), 849 'unsupported_image' => __( 'This image cannot be displayed in a web browser. For best results convert it to JPEG before uploading.' ), 849 850 ); 850 851
Note: See TracChangeset
for help on using the changeset viewer.