Grant Contributor to Upload Files
-
Hi,
I need to grant the upload file capability to all contributor users in WordPress. I understand that this will involve either the current_user_can or add_cap function, but I don’t know what file is designated to assign capabilities to users. What file should I tweak the settings?
I saw a sample configuration on the Codex page, and I’ve created the following excerpt:
function add_contrib_caps() {
$role = get_role( ‘contributor’ );
$role->add_cap( ‘upload_files’ );
}
add_action( ‘admin_init’, ‘add_contrib_caps’);I looked up admin_init, and it’s suppose to run before the back end panel starts. So, perhaps I should place the function in the admin.php?
Angela
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Grant Contributor to Upload Files’ is closed to new replies.