Custom Outputs

You can customise the default output styles that are registered by Delightful Downloads using the dedo_get_styles filter. This will allow you to add or remove output styles that are used by the [ddownload] shortcode and will also affect which output styles are shown by the shortcode generator. In addition, any custom outputs can be selected as the default style in the Settings screen under the Shortcodes tab.

Custom Outputs Shortcodes Generator

Custom Outputs Settings Screen

The following output styles are registered by default:

You will notice that various wildcards are used to enter dynamic content such as %url% and %text%. A full list of the available wildcards can be found here.

Add Outputs

To add a new output style to those already registered by Delightful Downloads simply add a new key to the $styles array:

To completely replace the default output styles simply overwrite the $styles array:

You use a custom output like so, [ddownload id="123" style="icon_link"].

Remove Outputs

Existing outputs can be removed by simply unsetting them. The following snippet will remove the plain text output:

All of the above code snippets should be added to your theme’s function.php file.