I'm trying to modify all image attachment links to include a rel value thus:
add_filter( 'wp_get_attachment_link', 'my_prettyadd', 100, 6);
function my_prettyadd( $markup, $id, $size, $permalink, $icon, $text ) {
$content = preg_replace("/<a/","<a rel=\"prettyPhoto[slides]\"",$markup,1);
return $content;
}
This has worked fine for me for ages, but recent installation of WP have meant this fails insofarin so far that the function is never called (I placed an exit; line in there and it has no effect. I know that my theme does not use wp_get_attachment_link and so I'm suspecting I'm barking up the wrong tree now.
I'm using Canvas by WooThemes - I don't know if they dohave done anything out of the ordinary with attachments in posts. Anything obviously wrong in what I"m doing?