- This topic has 7 replies, 3 voices, and was last updated 6 years, 3 months ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- You must be logged in to reply to this topic.
WordPress Membership Plugin
Simple Membership Plugin › Forums › Simple Membership Plugin › Open "After Login Page Link" Shortcode to CURRENT Tab?
Tagged: After Login Page Link, redirect
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
Hi, where does that shortcode come from?
Thank you
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.
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.
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
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"]
Awesome. Thanks!