Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created January 24, 2012 14:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save billerickson/1670316 to your computer and use it in GitHub Desktop.
Save billerickson/1670316 to your computer and use it in GitHub Desktop.
Customize Roles & Capabilities
<?php
/**
* Customize Roles & Capabilities
*
* @package Dachis
* @subpackage Core Functionality
* @version 1.0
* @author Bill Erickson <bill@billerickson.net>
* @copyright Copyright (c) 2011, Bill Erickson
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*
*/
add_action( 'admin_init', 'be_contributor_upload_files' );
/**
* Add 'upload_files' capability to 'contributor' role
* @author Bill Erickson
* @link http://www.nouveller.com/quick-tips/quick-tip-9-change-the-default-capabilities-of-wordpress-users-with-ease/
*/
function be_contributor_upload_files() {
$edit_contributor = get_role('contributor');
$edit_contributor->add_cap('upload_files');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment