-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce webp_uploads_get_content_image_mimes()
to get content image MIME replacement rules
#420
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added some feedback regarding the doc block and code changes. PR 418 only allows a smaller version of an additional mime type image when this PR is merged. After that, this PR needs to be updated according to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eugene-manuilov I don't think we should address this in the plugin, as it isn't really an appropriate solution, since in core we should do this primarily based on a parameter - and not just replace the images but use the right images from the start. See #414 (comment) for more details.
With that said, you already put some work into this and I think breaking out the filter into a separate function and moving the unnecessary function call below the foreach
loop are nice little improvements. So I'd say we can still merge this if we remove the new integrations around wp_get_image_attachment_src
.
modules/images/webp-uploads/load.php
Outdated
|
||
return $image; | ||
} | ||
add_filter( 'wp_get_attachment_image_src', 'webp_uploads_update_attachment_image_src', 10, 3 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is out of scope for the plugin, as functions controlled by developers should leave that control to developers. See #414 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. Reverted it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @eugene-manuilov! Will remove this PR from the issue since it doesn't really address it anymore, but rather is a nice little code enhancement.
@eugene-manuilov There are some merge conflicts here, can you look into those? This is not critical for the release since it's just a little code enhancement, so I'm going to move it to the next milestone. |
@felixarntz, merge conflicts are fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eugene-manuilov Just needs to correct the merge conflict.
webp_uploads_get_content_image_mimes()
to get content image MIME replacement rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eugene-manuilov Great!
Summary
Originally intended as a fix to #414, but that issue isn't feasible to fix in the plugin, so now it's just a little API enhancement.
Relevant technical choices
Checklist
[Focus]
orInfrastructure
label.[Type]
label.no milestone
label.