• Resolved redkite

    (@redkite)


    How do I change Custom Target’s default to _self for all the galleries in this album (actually for all FooGallery links). Right now all my galleries are opening the custom URLs in new tabs.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author bradvin

    (@bradvin)

    You can use the Custom Target attribute for each attachment, but that will probably be a lot of work for you.

    You can also use some custom code:

    
    function foogallery_override_target( $attr, $args, $foogallery_attachment ) {
    	$attr['target'] = '_self';
    	return $attr;
    }
    
    add_filter('foogallery_attachment_html_link_attributes', 'foogallery_override_target', 10, 3);
    

    which you can add to your functions.php

    Thread Starter redkite

    (@redkite)

    Thanks, I’ve added that. I would think this should be a setting in FooGallery since it’s an option that’s available with no way to implement it for many users who don’t know how to add things to functions.php.

    Plugin Author bradvin

    (@bradvin)

    Absolutely, I agree. I have never considered this scenario before. I have added it to our backlog a future release. cheers!

    Thread Starter redkite

    (@redkite)

    Thanks! That would be a great addition.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to change default link to _self?’ is closed to new replies.