Created
April 7, 2016 13:58
-
-
Save MrFent/23c4bc0a00f31e0da0717f347aed2831 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function show_download_links() { | |
if (is_product()) { | |
global $product; | |
$downloads = $product->get_files(); | |
foreach( $downloads as $key => $each_download ) { | |
echo '<a href="'.$each_download["file"].'">Download</a>'; | |
} | |
} | |
add_shortcode('download_links', 'show_download_links'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment