Just installed this on WordPress 3.5.1 and it appears to have no affect at all. Is it not compatible with the newest WordPress version?
]]>Hi sators,
A better implementation would be by subscribing to the “post_gallery” filter:
function gallery_link_none($output, $attr = array()) {
if (isset($attr["link"]) && $attr["link"] == "none")
return preg_replace(array('/<a[^>]*>(<img[^>]*>)<\/a>/'), '$1', $output);
return $output;
}
add_filter('post_gallery', 'gallery_link_none', 10001, 2);
This way it works with custom gallery plugins and also addresses the issue found by “livesimplybyannie”.
Can you please update the plugin?
Cheers,
Kaspars
Hi, hope someone can help me with this: I’ve created a shop page on my site that has lots of pictures of products. I have inserted captions beneath the images that are links to purchase them. I want to disable the link feature for the actual image but keep the link for the text caption underneath. This plugin seems to disable all links, both for the image and the text. Any way around this? Thanks!
Here’s a link for reference:
https://www.livesimplybyannie.com/shop/
Thanks! This is a function that should be part of WordPress.
]]>