Viewing 4 replies - 1 through 4 (of 4 total)
  • You would probably need to add a filter in your functions.php, something like the following:

    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 ) {
        if( $link == '' )
            return '[none]';
        else
            return $link;
    }

    I think that should see if the custom link is blank, and if so substitute in “[none]”. If the custom link had a value, it would be used instead. I haven’t tested this code, but I think in theory it should work.

    Note that that filter would be applied to all [gallery]s, so you may need to add some logic to prevent the snippet from running if you don’t want that behavior on particular galleries.

    Also if it’s on a gallery-by-gallery basis that you’re linking images or not, instead of an image-by-image, you can set the WordPress gallery setting to “none” as the link type for the gallery, without having to do anything through the plugin.

    Thread Starter newinca

    (@newinca)

    Thanks for this, Ill test it later and confirm it with you. Much appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to set all custom links to [none] by default’ is closed to new replies.