[wp-trac] [WordPress Trac] #21819: Use an image size for custom headers instead of duplicating an attachment
WordPress Trac
noreply at wordpress.org
Mon Oct 2 04:04:20 UTC 2017
#21819: Use an image size for custom headers instead of duplicating an attachment
-------------------------------------------------+------------------------
Reporter: koopersmith | Owner: joemcgill
Type: enhancement | Status: assigned
Priority: high | Milestone: 4.9
Component: Media | Version: 3.5
Severity: normal | Resolution:
Keywords: has-patch needs-testing 2nd-opinion | Focuses:
-------------------------------------------------+------------------------
Changes (by joemcgill):
* keywords: needs-patch => has-patch needs-testing 2nd-opinion
Comment:
[attachment:21819.diff] is a first pass at solving the problem as
articulated by @melchoyce:
> People like me upload a million different header images trying to figure
out what image and crop looks best, and then have two million copies
hanging out in our media libraries, which is super annoying. 😅
So far, this tackles 2/3 of the problem by ensuring only one crop exists
per theme for any given base image and removes old crops from the
"previous header images" list in the customizer. The final piece of the
puzzle is to hide all attachments created in the header image context from
the regular media library, where they just add noise.
It's worth noting that the current implementation makes use of a new post
meta key to track the original image from which each crop is created. We
might want to consider saving this as data to the regular attachment
metadata array or by making use of the native post_parent field of the
attachment.
Work in progress is happening in
[https://github.com/joemcgill/develop.wordpress/pull/21 this GitHub PR].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/21819#comment:37>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list