Configuring custom permissions for WordPress roles
- Log in to your WordPress site with an administrator account.
-
On the Dashboard in the left sidebar, click Appearance, and then click Editor:
-
On the Theme Editor, select the Theme you want to edit from the dropdown:
-
The files for this selected theme are listed on the right column under Theme Files. Click on the file named “functions.php”:
- Add this code snippet / function at the bottom of your functions.php file:
- With the above code snippet, you can turn the permission on / off by simple true / false value.
unfiltered_upload – This capability is not available to any role by default (including Super Admins). The capability needs to be enabled by defining the following constant: