Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

[Resolved] Open "After Login Page Link" Shortcode to CURRENT Tab?

Simple Membership Plugin › Forums › Simple Membership Plugin › Open "After Login Page Link" Shortcode to CURRENT Tab?

Tagged: After Login Page Link, redirect

  • This topic has 7 replies, 3 voices, and was last updated 6 years, 3 months ago by Jeff Norman.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • February 19, 2020 at 5:02 pm #19801
    Jeff Norman
    Participant

    Hi,

    The following shortcode opens to another tab:

    
    [swpm_show_after_login_page_link link_anchor="Return To Dashboard >"]
    

    How do I make it open in the current tab?

    Thanks

    February 19, 2020 at 9:26 pm #19803
    mbrsolution
    Moderator

    Hi, where does that shortcode come from?

    Thank you

    February 20, 2020 at 12:38 pm #19807
    Jeff Norman
    Participant

    The shortcode comes from the simple membership plugin documentation. Its for creating a link back to the logged in member’s initial page once they log in.

    February 20, 2020 at 12:43 pm #19808
    Jeff Norman
    Participant

    https://simple-membership-plugin.com/?s=after+login+link+shortcode

    February 20, 2020 at 8:41 pm #19809
    Jeff Norman
    Participant

    For some reason the shortcode is creating an html href link that defaults to a “target=_blank” attribute setting. I had to use JS to force all my links to open in the current tab to get it to work:

    <script>
    var a = document.getElementsByTagName("a");
    for (i=0;i<a.length;i++) {
     
    if (a[i].target="_blank") {
    a[i].target="_self"
    }
    
    }
    </script>

    It be helpful if it defaulted to a “_self” value on the “target” attribute making it open in the current tab by default, as most links do. It would be even more helpful if a user could add a target attribute to the shortcode itself and choose how the link works best for their particular site.

    February 20, 2020 at 9:30 pm #19811
    mbrsolution
    Moderator

    Thank you for providing more information and sharing your code. I have submitted a message to the developers to investigate further your request.

    Kind regards

    February 21, 2020 at 1:26 am #19814
    admin
    Keymaster

    I have updated the addon to add an extra parameter in that shortcode so this can be customized.

    Use the “link_target” parameter in the shortcode. Below is an example shortcode usage:

    
    [swpm_show_after_login_page_link link_anchor="Your Dashboard" link_target="_self"]
    
    February 21, 2020 at 2:00 pm #19816
    Jeff Norman
    Participant

    Awesome. Thanks!

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy