Docs / Download Manager Pro / wpdm_allowed_roles

wpdm_allowed_roles

Description


The wpdm_allowed_roles filter is used to modify the list of user roles allowed to download a specific package.

Parameters


Two parameters are passed to this hook.

Usage


 

<?php add_filter('wpdm_allowed_roles', 'my_wpdm_allowed_roles', 10, 2); ?>

Examples



<?php
add_filter('wpdm_allowed_roles', 'my_wpdm_allowed_roles', 10, 2);

function my_wpdm_allowed_roles($roles, $id) { 
    $roles[] = 'editor';
    return $roles;
}

?>
Last updated on January 26, 2026

Need Help?

Get support from our team or community forum.

Visit Support

Customization

Need custom features? We can help.

Request Quote