| | 14 | **Edit:** |
| | 15 | I nailed it down to new code introduced in function **create_item_permissions_check()** in version 6.8. |
| | 16 | |
| | 17 | Further down the code it appears that** wp_image_editor_supports()** returns false if image editing lirary is not enabled on server. |
| | 18 | |
| | 19 | I believe this is not a correct approach since whether file can be edited or not should not determine whether file can be uploaded or not. Not all servers have support for Imagick or GD and these should not be punished if admins are not planning to use image editing feature in a first place. |
| | 20 | |
| | 21 | **Workaround** |
| | 22 | Together with the new code mentioned above a new filter was introduced in WP 6.8: **wp_prevent_unsupported_mime_type_uploads** |
| | 23 | It can be used to disable this new behaviour. |
| | 24 | |
| | 25 | Nuclear option would be: |
| | 26 | |
| | 27 | {{{#!php |
| | 28 | <?php |
| | 29 | add_filter( 'wp_prevent_unsupported_mime_type_uploads', '__return_false' ); |
| | 30 | }}} |
| | 31 | |
| | 32 | More gradual option would be to expand the function to check what mime type is passed and return false only for images or whatever other file type affected in your project. |
| | 33 | The filter function passes mime type string. So, it could be something like this: |
| | 34 | |
| | 35 | {{{#!php |
| | 36 | <?php |
| | 37 | add_filter( 'wp_prevent_unsupported_mime_type_uploads', function($current, $mime) { |
| | 38 | return str_starts_with( $mime, 'image/' ) ? false : $current; |
| | 39 | }, 10, 2); |
| | 40 | }}} |