Title: Update
Last modified: August 20, 2016

---

# Update

 *  [kasparsj](https://wordpress.org/support/users/kasparsj/)
 * (@kasparsj)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/update-26/)
 * 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
 * [http://wordpress.org/extend/plugins/gallery-linknone/](http://wordpress.org/extend/plugins/gallery-linknone/)

Viewing 1 replies (of 1 total)

 *  [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/update-26/#post-3400662)
 * I love this idea, but it doesn’t seem to remove any links for me.
 *     ```
       [gallery ids="24,25,26,27" size="full" link="none" columns="1"]
       ```
   
 * Just produces linked images like normal.
 * I think because in the gallery shortcode callback you have:
 *     ```
       // Allow plugins/themes to override the default gallery template.
       	$output = apply_filters('post_gallery', '', $attr);
       	if ( $output != '' )
       		return $output;
       ```
   
 * which means your filter must actually create some markup, or the shortcode will
   just proceed to do its default markup.

Viewing 1 replies (of 1 total)

The topic ‘Update’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/gallery-linknone.svg)
 * [Gallery with No Image Links](https://wordpress.org/plugins/gallery-linknone/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gallery-linknone/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gallery-linknone/)
 * [Active Topics](https://wordpress.org/support/plugin/gallery-linknone/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gallery-linknone/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gallery-linknone/reviews/)

## Tags

 * [implementation](https://wordpress.org/support/topic-tag/implementation/)

 * 1 reply
 * 2 participants
 * Last reply from: [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/update-26/#post-3400662)
 * Status: not resolved