Can't figure out why this won't work:
function my_get_attachment_link($html){
$postid = get_the_ID();
$html = str_replace('<a','<a rel="shadowbox['.$postid.']"',$html);
return $html;
}
add_filter('wp_get_attachment_link','my_get_attachment_link',10,1);
Just trying to hook up all the images on a single post view to a lightbox script.
FYI, this didn't work either: http://wordpress.mfields.org/2010/thickbox-for-wordpress-gallery/#highlighter_196509
What could be jamming it up?
wp_get_attachment_link()
? A copy/paste of your code works with a call towp_get_attachment_link(36)
I randomly pasted into a template.