Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected behaviour for Open Download in New Tab #7

Open
wants to merge 26 commits into
base: bugfix/issue-1-extract-warning
Choose a base branch
from

Conversation

Giles-5
Copy link

@Giles-5 Giles-5 commented Aug 29, 2019

Ticking Open Download in New Tab adds in target="_blank" but leaves download. This can override the target instruction. Added a quick check to see if target is specified as _blank and not to include it if true.

@@ -4,7 +4,7 @@
<?php endif; ?>

<div class='wpcf7-download'>
<a href='<?= $url; ?>' class='<?= $button_classes; ?> wpcf7-btn' download>
<a href='<?= $url; ?>' class='<?= $button_classes; ?> wpcf7-btn' download target="<?= $target ?>">
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<a href='' class=' wpcf7-btn' download target="">

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First time trying to do this on gitHub so not sure I got it right, my code suggestion is:
<a href='<?= $url; ?>' class='<?= $button_classes; ?> wpcf7-btn' <?php if ( $target=="_blank" ) : ?>download <?php endif; ?> target="<?= $target ?>">

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry think I might have got comparator wrong way round, should read:
<?php if ( $target!="_blank" )

@Giles-5 Giles-5 marked this pull request as ready for review August 29, 2019 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants