The [wpdm_direct_link] shortcode creates a simple text link that triggers a download when clicked. Unlike other shortcodes that display package information, this creates a minimal inline link.
Basic Syntax
[wpdm_direct_link id="123"]
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| id | integer | Yes | — | The package ID |
| label | string | No | Download | Link text displayed to users |
| target | string | No | — | Set to _blank to open in new tab |
| class | string | No | — | CSS class names for styling |
| eid | string | No | — | HTML element ID attribute |
| style | string | No | — | Inline CSS styles |
Usage Examples
Basic Link
[wpdm_direct_link id="42"]
Output: Download
Custom Label
[wpdm_direct_link id="42" label="Get the PDF"]
Output: Get the PDF
Open in New Tab
[wpdm_direct_link id="42" label="Download Now" target="_blank"]
Styled Link
[wpdm_direct_link id="42" label="Download" class="btn btn-primary" style="font-weight: bold;"]
Inline in Text
Perfect for embedding downloads within paragraphs:
You can [wpdm_direct_link id="42" label="download the user guide"] to learn more about the features.
Tips
- This shortcode respects all package access controls (roles, locks, etc.)
- If the user doesn’t have access, the link will redirect to the package page to show unlock options.
- Use the
classparameter to apply button styles from your theme.
Related
- [wpdm_package] – Display package with full template
- [wpdm_packages] – Display multiple packages