Created
May 12, 2020 22:12
-
-
Save pedrorvidal/0c3bf757acd1a6ac5f75fb95acad7ee2 to your computer and use it in GitHub Desktop.
roles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_theme_caps() { | |
// gets the author role | |
$role = get_role( 'testarole' ); | |
// create if neccesary | |
if (!$role) $role = add_role('testarole', 'Testa Role'); | |
// add theme specific roles | |
$role->add_cap('delete_posts'); | |
$role->add_cap('delete_published_posts'); | |
$role->add_cap('edit_posts'); | |
$role->add_cap('edit_published_posts'); | |
$role->add_cap('publish_posts'); | |
$role->add_cap('read'); | |
$role->add_cap('upload_files'); | |
} | |
add_action( 'admin_init', 'add_theme_caps'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment