Action and Filter Reference

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

Actions

dlm_downloading Triggered when a file is downloaded by a user. Passes $download and $version.
dlm_options_start Triggered at the start of the admin meta box for adding your own options.
dlm_options_end Triggered at the end of the admin meta box for adding your own options.
dlm_save_meta_boxes Triggered on save.

Filters

dlm_404_redirect Return a url to redirect somewhere if the link is a 404. Default is false.
dlm_access_denied_redirect Return a url to redirect somewhere if the user cannot access a file. Default is false.
dlm_can_download True if the user has permission to access the file. Can be used by third party plugins. Passes $download and $version.
dlm_do_not_force True if you want to redirect to the download instead of forcing it. Passes $download and $version.
dlm_placeholder_image_src Filtered URL to the placeholder image for download thumbnails.
dlm_download_get_the_download_link Filter for the download URLs.
dlm_shortcode_download_id Used in shortcodes to filter the download ID if needed.
dlm_cpt_dlm_download_args Array of args used to register the dlm_download custom post type.
dlm_cpt_dlm_download_supports As above but for the ‘supports’ var only.
dlm_cpt_dlm_download_version_args Array of args used to register the dlm_download_version custom post type.
download_monitor_settings Filter for changing core settings.
dlm_widget_downloads_list_start Before the widget list of downloads. Default is <ul class="dlm-downloads">
dlm_widget_downloads_list_end After the widget list of downloads. Default is </ul>
dlm_widget_downloads_list_item_start Before each item in the download widget. Default is <li>
dlm_widget_downloads_list_item_end After each item in the download widget. Default is </li>

Was this article helpful? Yes · No