SOPG

Forum Replies Created

Viewing 1 post (of 1 total)
in reply to: Fatal error when adding "wpdm_allowed_roles" filter #70641

SOPG
Member

Thank you for your fast reply,

and no, I don’t really wanna hardcode the allow access roles, I just want to add “editor” and “administrator” to the allow access roles for a file in PHP runtime, when “subscriber” is allowed to download that file. The reason is that from the hierarchical point of view, editors and administrators are allowed to do all things, a subscriber is allowed to do and we don’t wanna add all three roles (“subscriber”, “editor” and “administrator”) for each of our files.

Besides there is the apply_filter(‘wpdm_allowed_roles’, $id, $roles) command in WPDM\Pakage::AllowedRoles($id), line 306, which would be a really great solution for adding allowed access roles, based on the existing allowed access roles and perhaps other conditions 😉 But adding a “wpdm_allowed_roles” filter, using the WordPress built-in add_filter() function regretfully ends in a fatal error. 🙁

Thanks and best regards
Michael

Viewing 1 post (of 1 total)