Skip Navigation

[Resolved] How to set target="_blank" for [wpv-post-edit-link]

This support ticket is created 2 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 2 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#2470279

Tell us what you are trying to do? Set target="_blank" for [wpv-post-edit-link]

It does not work like [wpv-post-link] where I can specify the URL alone, allowing me to build my own anchor tag.

#2470361

Hi,

Thank you for contacting us and I'd be happy to assist.

Your observation is correct and the "wpv-post-edit-link" shortcode doesn't support the option to add target="_blank" attribute.

To achieve this, you can include some custom script, in your content template's "JS editor":


jQuery(document).ready(function( $ ) {
    $('a.new-tab-link').attr('target','_blank');
});

This script will find all the link (a) tags with the class "new-tab-link" and append the target="_blank" attribute to them.

Next, you can include this class "new-tab-link", to your post edit link, like this:


[wpv-post-edit-link text="Edit link" class="new-tab-link"]

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar