[wp-trac] [WordPress Trac] #42487: Avoid redundant crops for all Customizer media controls.
WordPress Trac
noreply at wordpress.org
Thu Nov 9 17:09:19 UTC 2017
#42487: Avoid redundant crops for all Customizer media controls.
----------------------------+------------------------------------------
Reporter: joemcgill | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version:
Severity: normal | Keywords: needs-patch needs-unit-tests
Focuses: ui, javascript |
----------------------------+------------------------------------------
In WordPress 4.9, we made use of context metadata to keep from producing
redundant crops in the media library for custom headers (see #21819). We
should extend this behavior to all other media controls in the Customizer
(e.g., custom logos, site icon, etc.).
There are a few parts to the implementation to keep in mind:
1. We should only create one cropped attachment per context for a given
site/theme option. So for instance, if a custom logo has already been
cropped from an attachment for the theme being customized, we should
replace that attachment instead of creating a new one. However, we
''should'' create a new attachment if the crop was created for a different
theme (this may not apply to site-level settings).
2. The context of an attachment should be included in the JSON model
returned by `wp_prepare_attachment_for_js()` and used to filter contextual
crops out of the main media attachment library. However, it would be great
if those were ''not'' filtered when you've opened the media library from
the context which those attachments are created/selected.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42487>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list