Allow non-Admins to manage downloads

[ad_1]

Plugin Author
Razvan

(@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

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer