diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index c0ac177..3331709 100644
|
|
|
1734 | 1734 | ] |
1735 | 1735 | }); |
1736 | 1736 | |
| 1737 | //If the library mime type is set to image, we should do the same for uploads |
| 1738 | if ( this.params.mime_type == 'image' ) { |
| 1739 | this.frame.uploader.options.uploader.filter = this.params.mime_type; |
| 1740 | } |
| 1741 | |
1737 | 1742 | // When a file is selected, run a callback. |
1738 | 1743 | this.frame.on( 'select', this.select ); |
1739 | 1744 | }, |
… |
… |
|
2373 | 2378 | ] |
2374 | 2379 | }); |
2375 | 2380 | |
| 2381 | //Since the library mime type is set to image, we should do the same for uploads |
| 2382 | this.frame.uploader.options.uploader.filter = 'image'; |
| 2383 | |
| 2384 | |
2376 | 2385 | this.frame.on('select', this.onSelect, this); |
2377 | 2386 | this.frame.on('cropped', this.onCropped, this); |
2378 | 2387 | this.frame.on('skippedcrop', this.onSkippedCrop, this); |
diff --git src/wp-includes/js/plupload/wp-plupload.js src/wp-includes/js/plupload/wp-plupload.js
index 09a37ce..e24d004 100644
|
|
window.wp = window.wp || {}; |
32 | 32 | browser: 'browse_button', |
33 | 33 | dropzone: 'drop_element' |
34 | 34 | }, |
35 | | key, error; |
| 35 | filter, key, error; |
36 | 36 | |
37 | 37 | this.supports = { |
38 | 38 | upload: Uploader.browser.supported |
… |
… |
window.wp = window.wp || {}; |
49 | 49 | this.plupload = $.extend( true, { multipart_params: {} }, Uploader.defaults ); |
50 | 50 | this.container = document.body; // Set default container. |
51 | 51 | |
| 52 | //Restrict what file types can be uploaded. Taking a string of extensions 'jpg,gif,png' |
| 53 | //If filter is set to 'image' we'll convert to correct extensions |
| 54 | this.filter = options.filter; |
| 55 | if ( this.filter == 'image' ) { |
| 56 | this.filter = 'jpeg,jpg,gif,png,svg,webp'; |
| 57 | } |
| 58 | |
| 59 | if ( this.filter ) { |
| 60 | this.plupload.filters.mime_types = [ { extensions: this.filter } ]; |
| 61 | } |
| 62 | |
52 | 63 | // Extend the instance with options. |
53 | 64 | // |
54 | 65 | // Use deep extend to allow options.plupload to override individual |