Skip to content

Instantly share code, notes, and snippets.

@barrykooij
Created January 24, 2018 21:53
Show Gist options
  • Save barrykooij/de6bba0f6823f5bff5b30b1cd18b876f to your computer and use it in GitHub Desktop.
Save barrykooij/de6bba0f6823f5bff5b30b1cd18b876f to your computer and use it in GitHub Desktop.
Page Addon - Direct link to download (no detail page)
<?php
/**
* Default output for a download via the [download] shortcode
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
/** @var DLM_Download $dlm_download */
global $dlm_page_addon;
?>
<a class="download-link" href="<?php echo $dlm_download->get_the_download_link(); ?>" rel="nofollow">
<?php $dlm_download->the_title(); ?> (<?php printf( _n( '1', '%d', $dlm_download->get_download_count(), 'dlm_page_addon' ), $dlm_download->get_download_count() ) ?>)
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment