Last active
December 28, 2015 19:59
-
-
Save woogist/7554026 to your computer and use it in GitHub Desktop.
Add the following to your theme's functions.php to make all WooCommerce Product Documents links open in a new window/tab http://www.woothemes.com/products/product-documents/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wc_product_documents_link_target', 'wc_product_documents_open_link_in_new_window', 10, 4 ); | |
/** | |
* Opens all product documents links in new window/tabs | |
*/ | |
function wc_product_documents_open_link_in_new_window( $target, $product, $section, $document ) { | |
return '_blank'; | |
} |
Sorry, we actually don't get alerts for comments left here so we had no idea you had trouble with this. I just tested with the latest version of Product Documents, and simply putting this code at the bottom of the current theme's functions.php file did the trick. Hopefully you've already gotten this working!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have installed the code in the functions.php file. I am not seeing the behavior the code is supposed to provide. Is there a specific location in the file it needs to go. Can you give me a little more detail about this code?
Thanks
Phil