Simon Frost

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
in reply to: Open PDF in a new tab #150891

Simon Frost
Participant

I also have a closely related question, but to do with the wpdm_tree shortcode that comes from the WPDM Extended Shortcodes add-on.

This is the code I’m using to generate a file tree:
[wpdm_tree newwin=1 download_link=1 category="about-us"]

I was looking at the code to work out where to put the target=_blank code so that these links would open in a new tab as well, and while in the PHP file I found an undocumented shortcode parameter called newwin which appears to add the target=_blank to the generated link tree.. except it doesn’t work. I can see in the page source that target="_blank" is part of the <a tag, but when I click the link it opens in the same window anyway. Is there JavaScript somewhere that’s overriding this?

Thanks so much for your help here!

in reply to: Open PDF in a new tab #150890

Simon Frost
Participant

Hi Humayon,
Thanks so much for that code – I applied it to the file and it is working.

I just want to confirm how I would go about relocating the edited file elsewhere so the change survives plugin upgrades? Similar to the original response in this thread, would I create a folder within the child-theme called wpdm-button-templates and put the edited file there?

in reply to: Open PDF in a new tab #150692

Simon Frost
Participant

Hi Nayeem, I am working on this project with Arianna and am trying to make these changes. I understand what you’ve written, but as we’re using the WPDM Button Templates add-on I think the template file is located elsewhere – it’s probably coming from plugins/wpdm-button-templates/wpdm-button-templates.php

The trouble I have now is that the [download_link] text is in code like this:

if(!wpdm_is_locked($id) && wpdm_user_has_access($id)){
  return "<a href='".wpdm_download_url($package)."'>{$html}</a>";
} else
  return FetchTemplate("[download_link]", $package);

I’m not sure how to replace or modify this without breaking the code – I’m not a PHP developer so I’m just using educated guesses here.

Viewing 3 posts - 1 through 3 (of 3 total)