• Resolved TrishaM

    (@trisham)


    I use this plugin and need non-Admin level people to be able to add and manage downloadable items, however no one below Admins can see the menu link. I would encourage you to add a setting for permission level, but in the meantime I would appreciate a code snippet I can use to extend the ability to manage our downloads to Editors.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Razvan Aldea

    (@raldea89)

    Hello @trisham ,

    An extension meant for that purpose is actually on our roadmap, but until then, in order for Editors to edit Downloads, a capability called manage_downloads need to be added to them. In order to do so you have 2 options:

    1. Use a role editing plugin to add the above mentioned capability. After you add it and test that the Editor can edit Downloads you can deactivate the plugin.
    2. Use the following snippet in your child theme’s fucntions.php file and the same, after you test that the Editor can edit Downloads you can delete the code

    add_action(
    	'admin_init',
    	function () {
    		global $wp_roles;
    
    		if ( class_exists( 'WP_Roles' ) && ! isset( $wp_roles ) ) {
    			$wp_roles = new WP_Roles();
    		}
    
    		if ( is_object( $wp_roles ) ) {
    			$wp_roles->add_cap( 'editor', 'manage_downloads' );
    		}
    	}
    );

    That’s about it. Please let me know about the outcome.

    Warmly,
    Razvan

    Thread Starter TrishaM

    (@trisham)

    That works perfectly, thank you very much!!

    Plugin Author Razvan Aldea

    (@raldea89)

    Awesome ??

    Have a wonderful day!
    Razvan

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Allow non-Admins to manage downloads’ is closed to new replies.