Specify custom links for WordPress gallery images (instead of attachment or file only).
If you've ever had a WordPress gallery of staff, product, or other images and needed to link them to other pages but couldn't, this plugin is for you!
This plugin adds a "Gallery Link URL" field when editing post images. If the image is included in a gallery, the "Gallery Link URL" value will be used as the link on the image instead of the raw file or the attachment post. There are also several additional options (see "Usage" below).
It's designed to work even if customizations have been made via the post_gallery filter; instead of replacing the entire post_gallery function, it calls the normal function and simply replaces the link hrefs in the generated output. By default, any Lightbox or other onClick events on custom links will be removed to allow them to function as regular links.
[gallery ignore_gallery_link_urls="true"] to ignore the custom links on an entire gallery.[gallery open_all_in_new_window="true"] and [gallery open_all_in_same_window="true"] to open all images in an entire gallery in a new window/the same window, respectively.[gallery preserve_click_events="true"] to keep Lightbox or other onClick events on all custom-linked images in an entire gallery.[gallery remove_links="true"] to remove links on all images in an entire gallery.add_filter( 'wpgcl_filter_raw_gallery_link_url', 'my_gallery_link_url_filter', 10, 3 );
function my_gallery_link_url_filter( $link, $attachment_id, $post_id ) { return '/en/' . $link; }
Requires: 3.3.2 or higher
Compatible up to: 3.5.1
Last Updated: 2013-4-18
Downloads: 22,272
8 of 9 support threads in the last two months have been resolved.
Got something to say? Need help?