Title: Switch off target self
Last modified: August 22, 2016

---

# Switch off target self

 *  Resolved [deroccha](https://wordpress.org/support/users/deroccha/)
 * (@deroccha)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/switch-off-target-self/)
 * Hi I use your plugin. Because I use AngularJS I try to override with a custom
   hook to remove target=”_self” but without any luck. Where to out comment the 
   plugins code to achive the desired result?
 * [https://wordpress.org/plugins/wp-gallery-custom-links/](https://wordpress.org/plugins/wp-gallery-custom-links/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [fourlightsweb](https://wordpress.org/support/users/fourlightsweb/)
 * (@fourlightsweb)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/switch-off-target-self/#post-5446510)
 * Unfortunately there’s not currently a setting to disable this. I would suggest
   using jQuery to remove the attribute from all links in the gallery, something
   like the following (not tested):
 *     ```
       jQuery('#gallery-2 a').removeProp('target');
       ```
   
 * If you really wanted to modify the plugin code, you could probably comment out
   where $target is set to “self” if the value is blank (also untested):
 *     ```
       if( trim( $target ) == '' ) {
           // If empty string ("Same Window") is selected, set target to _self
           $target = '_self'; // <-- comment this out
       ```
   
 * I would recommend going the jQuery route over the plugin modification route, 
   as you would need to remember that change and continually make it every time 
   the plugin is updated.
 *  Thread Starter [deroccha](https://wordpress.org/support/users/deroccha/)
 * (@deroccha)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/switch-off-target-self/#post-5446511)
 * Thanks for feedback I realized that is not possible to override with own filter.
   I made it it with jQurey.
 * Thanks again, nice plugin we can close the issue

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Switch off target self’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-gallery-custom-links_d3d5d9.svg)
 * [WP Gallery Custom Links](https://wordpress.org/plugins/wp-gallery-custom-links/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-gallery-custom-links/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-gallery-custom-links/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-gallery-custom-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-gallery-custom-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-gallery-custom-links/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [deroccha](https://wordpress.org/support/users/deroccha/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/switch-off-target-self/#post-5446511)
 * Status: resolved