Created
August 31, 2012 02:41
-
-
Save bmsterling/3548231 to your computer and use it in GitHub Desktop.
Add attributes to attachment links wp_get_attachment_link
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_attr_attachment_link($html){ | |
$attr = array( | |
// array of attributes | |
); | |
$html = str_replace('<a','<a '.join(' ',$attr),$html); | |
return $html; | |
} | |
add_filter('wp_get_attachment_link','add_attr_attachment_link',10,1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment