1. Home
  2. Knowledge Base
  3. Advanced
  4. Action and Filter Reference

Action and Filter Reference

Download Monitors comes with various actions and filters that allow you to hook into certain events or alter certain variables. You can read more about WordPress Actions here and about WordPress Filters here.

Action

dlm_downloadingTriggered when a file is downloaded by a user. Passes $download and $version.
dlm_options_startTriggered at the start of the admin meta box for adding your own options.
dlm_options_endTriggered at the end of the admin meta box for adding your own options.
dlm_save_meta_boxesTriggered on save.

 Filters

dlm_404_redirectReturn a URL to redirect somewhere if the link is a 404. Default is false.
dlm_access_denied_redirectReturn a URL to redirect somewhere if the user cannot access a file. Default is false.
dlm_can_downloadTrue if the user has permission to access the file. Can be used by third-party plugins. Passes $download and $version.
dlm_do_not_forceTrue if you want to redirect to the download instead of forcing it. Passes $download and $version.
dlm_placeholder_image_srcFiltered URL to the placeholder image for download thumbnails.
dlm_download_get_the_download_linkFilter for the download URLs.
dlm_shortcode_download_idUsed in shortcodes to filter the download ID if needed.
dlm_cpt_dlm_download_argsArray of args used to register the dlm_download custom post type.
dlm_cpt_dlm_download_supportsAs above but for the ‘supports’ var only.
dlm_cpt_dlm_download_version_argsArray of args used to register the dlm_download_version custom post type.
download_monitor_settingsFilter for changing core settings.
dlm_widget_downloads_list_startBefore the widget list of downloads. Default is <ul class="dlm-downloads">
dlm_widget_downloads_list_endAfter the widget list of downloads. Default is </ul>
dlm_widget_downloads_list_item_startBefore each item in the download widget. Default is <li>
dlm_widget_downloads_list_item_endAfter each item in the download widget. Default is </li>
Was this article helpful?

Related Articles

In this article

Start Protecting your WordPress Downloads

Protect and track downloads on WordPress... What are you waiting for?