Op-edHow To Enable Contributors To Manage Media In WordPress?

How To Enable Contributors To Manage Media In WordPress?

WordPress is a very advance Content Management System (CMS) but still lacks some basic features. In our this post we will help you in granting or setting permission for the Contributor and other Users who doesn’t have right to Upload files like images and other media files or are not able to Manage Media in WordPress and that’s without installing any plugin.

Also Read: Adding Facebook, Twitter, Reddit and LinkedIn Social Share links to WordPress without any Plugin

In order to assign permission to manage media to non-admin or the users who are missing the Media Option in their WordPress control panel you need to add following PHP code in to your theme’s functions.php file. The functions.php file you can located in wp-content/themes/YOUR-THEME-NAME/functions.php of your wordpress root directory using your cPanel control or FTP or alternative to this you can do so from your WordPress Admin Panel. Follow below steps in order to add the code into functions.php using WordPress Admin Panel you :

  1. Login into your WordPress Admin Panel.
  2. Go to Appearance menu (located to the left-sidebar).
  3. Under Appearance menu click on Editor option.
  4. In the right to your Admin Panel within Editor page located Theme Functions  or functions.php.
  5. Add below code and Click on Update File.
$grant_user="User Role" //eg. Contributor or Editor or Author
if ( current_user_can($grant_user) && !current_user_can('upload_files') )
    add_action('admin_init', 'grant_contributor_uploads');
function grant_contributor_uploads() {
    $contributor = get_role('contributor');
    $contributor->add_cap('upload_files');
}

Cheers!
You have granted the permission!

IR Media Team
IR Media Team
IR Media Team is a member of Digital Pradesh News Networks, a collective of journalists, reporters, writers, editors, lawyers, advocates, professors, and scholars affiliated with the Digital Pradesh News Networks.

Latest Updates