-
Notifications
You must be signed in to change notification settings - Fork 130
Closed
Labels
Needs DevAnything that requires development (e.g. a pull request)Anything that requires development (e.g. a pull request)[Plugin] Modern Image FormatsIssues for the Modern Image Formats plugin (formerly WebP Uploads)Issues for the Modern Image Formats plugin (formerly WebP Uploads)[Type] BugAn existing feature is brokenAn existing feature is broken
Milestone
Description
Bug Description
As we have provided filter webp_uploads_upload_image_mime_transforms
for the mime type transforms in any case user does not want to transform the mime type then they just return empty
, true/false
or array()
then this file helper.php code is not require because $transforms = (array) apply_filters( 'webp_uploads_upload_image_mime_transforms', $default_transforms );
filter always retunt array value.
Return type empty
add_filter('webp_uploads_upload_image_mime_transforms', function () {
return;
});
Return type true/false
add_filter('webp_uploads_upload_image_mime_transforms', function () {
return false;
});
Return type empty array:
add_filter('webp_uploads_upload_image_mime_transforms', function () {
return array();
});
Also, we have to check if an array is null and then return an empty array so it can't execute next foreach code.
Additional Context
- PHP Version: 8.0.15
- OS: Windows
- Browser: Chrome
- Plugin Version: 1.1.0
Metadata
Metadata
Assignees
Labels
Needs DevAnything that requires development (e.g. a pull request)Anything that requires development (e.g. a pull request)[Plugin] Modern Image FormatsIssues for the Modern Image Formats plugin (formerly WebP Uploads)Issues for the Modern Image Formats plugin (formerly WebP Uploads)[Type] BugAn existing feature is brokenAn existing feature is broken