wp_get_attachment_link filter not working
Have you tried using the ‘the_content’ filter? Something like this should probably do the Job , note that i have not had the time to test this . function my_prettyadd($content) { global $post; $pattern = “/(<a(?![^>]*?rel=[‘\”]prettyPhoto.*)[^>]*?href=[‘\”][^’\”]+?\.(?:bmp|gif|jpg|jpeg|png)[‘\”][^\>]*)>/i”; $replacement=”$1 rel=”prettyPhoto[“.$post->ID.’]”>’; $content = preg_replace($pattern, $replacement, $content); return $content; } add_filter(“the_content”,”my_prettyadd”); simple regex that will add a rel to … Read more