WordPress how to give file or image upload permission to subscriber or contributer

In general a subscriber or contributer type user have not permission to upload image in wordpress so to give permission to upload image to subscriber or contributer type user need to write function or install a plugin

Media Library

Media Library

The functions to give file upload permission to a user

Now write the code in your functions.php file to give image upload permission to subscriber type user

add_cap('upload_files'); 
}
endif;
?>

and write the code in functions.php file to give image upload permission to contrubuter type user

add_cap('upload_files'); 
}
endif;
?>

You can use the Capability Manager Enhanced plugin also to give permissions

and for that first chose user then select the permission you want to give and press save.
Permission to upload from frontend

You need to use the code add_action('init', 'allow_contributor_media'); in place of admin_init if you are using the code or function writing in functions.php file , or if you are using the plugin Capability Manager Enhanced then you need to give all the permission for pages then only you can be able to upload image from front end.

Thanks for reading.

Share The Post On -

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.