[wp-trac] [WordPress Trac] #21389: Retina theme custom headers
WordPress Trac
noreply at wordpress.org
Thu Nov 5 21:41:03 UTC 2015
#21389: Retina theme custom headers
-------------------------------------------------+-------------------------
Reporter: nacin | Owner: joemcgill
Type: task (blessed) | Status: assigned
Priority: normal | Milestone: 4.4
Component: Customize | Version:
Severity: normal | Resolution:
Keywords: responsive-images has-patch 2nd- | Focuses:
opinion |
-------------------------------------------------+-------------------------
Comment (by joemcgill):
As @azaozz noted, the internals of `wp_get_attachment_image()` is not the
most efficient piece of code and [attachment:21389.1.diff] would be an
improvement there. My main concern is that we are essentially duplicating
a lot of the functionality between the two functions, which doesn't feel
right either. Since the header image is only called once per page, I would
probably trade some efficiency for DRYness here, but either approach
works.
I do prefer the approach in [attachment:21389.1.diff] over
[attachment:21389.2.diff], because we shouldn't bother calculating
`srcset` and `sizes` attributes if they are going to be overridden later
in the same function.
I also believe we would need to generate an `alt` tag, even if it's empty
by default, for a11y reasons.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/21389#comment:31>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list