[wp-trac] [WordPress Trac] #41574: Add filter: wp_get_attachment_link_attributes

WordPress Trac noreply at wordpress.org
Thu Feb 7 19:51:49 UTC 2019


#41574: Add filter: wp_get_attachment_link_attributes
-----------------------------------+------------------------------
 Reporter:  NathanAtmoz            |       Owner:  (none)
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Media                  |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+------------------------------
Changes (by aaroncampbell):

 * keywords:  has-patch => has-patch 2nd-opinion


Comment:

 Overall I like the idea here. Being able to add classes and such to the
 `<a>` element would be helpful, and with the
 [https://caniuse.com/#feat=download download attribute] gaining browser
 support, I can see that being useful too.

 I do have a small concern here though: The `$attr` that’s passed into
 `wp_get_attachment_link()` currently just passes through to
 `wp_get_attachment_image()`. That’s going to be really weird once the
 links support attributes themselves.

 Does anyone have any thoughts on what can be done there to keep back
 compat and ease confusion? Maybe rename that parameter? Do we need to add
 yet ANOTHER parameter there for consistency?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/41574#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list