[wp-trac] [WordPress Trac] #48489: Big image size threshold should take into account registered image sizes.
WordPress Trac
noreply at wordpress.org
Tue Sep 17 23:35:47 UTC 2024
#48489: Big image size threshold should take into account registered image sizes.
-------------------------------------------------+-------------------------
Reporter: johnbillion | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future
| Release
Component: Media | Version: 5.3
Severity: normal | Resolution:
Keywords: good-first-bug has-patch has-unit- | Focuses:
tests |
-------------------------------------------------+-------------------------
Changes (by eclev91):
* keywords: good-first-bug has-patch needs-unit-tests => good-first-bug
has-patch has-unit-tests
Comment:
You could get your threshold with a one-liner - `max( array_merge( [ 2560
], wp_list_pluck( wp_get_registered_image_subsizes(), 'width' ) ) )`
Does it make sense to split this out into two different threshold values?
One for height and one for width? This may require some additional
considerations in the resize call that happens if you went that route.
As far as the core theme behavior, correct me if I'm wrong, but I only see
that in twentytwenty, and I believe its behavior would be unchanged if you
were to omit the height argument entirely. I could be wrong. A different
ticket might suggest changing that in twentytwenty.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48489#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list