You can do that, but it would require modifying the core (which I have been told is a no no).
No Core Mod:
Add this to your functions.php file in your theme:
add_filter('gallery_style', create_function('$a', 'return "
<div class=\'gallery\'>";'));
add_filter( 'wp_get_attachment_link' , 'add_lighbox_rel' );
function add_lighbox_rel( $attachment_link ) {
if( strpos( $attachment_link , 'a href') != false && strpos( $attachment_link , 'img src') != false )
$attachment_link = str_replace( 'a href' , 'a rel="lightbox" href' , $attachment_link );
return $attachment_link;
}
and for good measure use the following jquery:
$(".gallery a, .lightbox, .gallery a[rel^='prettyPhoto'], a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
I use several different classes and attributes to cover all basis.
Core mod: go to your-wordpress-folder/wp-includes/post-template.php
Line 941 – Make it look like this:
return apply_filters( 'wp_get_attachment_link', "<a href='$url' rel='prettyPhoto[g]' title='$post_title'>$link_text</a>", $id, $size, $permalink, $icon, $text );
The [g] is to allow for the “gallery” function to activate.
Hope this helps!