[wp-trac] [WordPress Trac] #22075: Allow custom attributes to be set in `wp_get_attachment_link`

WordPress Trac noreply at wordpress.org
Fri May 23 20:00:33 UTC 2014


#22075: Allow custom attributes to be set in `wp_get_attachment_link`
--------------------------+-----------------------------
 Reporter:  webord        |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Media         |     Version:  3.4
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |     Focuses:
--------------------------+-----------------------------

Comment (by ericlewis):

 After thinking about this for a bit, I'm not sure we want to tack on more
 options to this function.

 The [http://wordpress.stackexchange.com/questions/65982 question from
 WPSE] asks "how do I customize the output of the gallery shortcode to look
 nothing like what it does out of the box," and in all honesty if you want
 to do that, you should probably do it via the `post_gallery` shortcode.

 To the topic at hand, if you want to add custom attributes to the anchor
 tag in `wp_get_attachment_link()`, you should probably use the
 `wp_get_attachment_link` filter and instead of regexing just rebuild the
 string however you see fit.

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


More information about the wp-trac mailing list