Created
April 1, 2019 10:51
-
-
Save Glinkfr/a4fb53c20cf463bb524f8598fe49bddd to your computer and use it in GitHub Desktop.
Ajouter un rôle utilisateur supplémentaire à WordPress
This file contains hidden or 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 modify_capabilities() { | |
$editor_role = get_role('author'); | |
add_role('authorplus', 'AuteurPlus', $editor_role->capabilities); | |
$owner_role = get_role('authorplus'); | |
$owner_role->add_cap('edit_others_posts'); | |
$owner_role->add_cap('delete_others_posts'); | |
$owner_role->add_cap('read_private_posts'); | |
$owner_role->add_cap('delete_private_posts'); | |
$owner_role->add_cap('edit_private_posts'); | |
$owner_role->add_cap('unfiltered_html'); | |
$owner_role->add_cap('moderate_comments'); | |
$owner_role->add_cap('manage_categories'); | |
$owner_role->add_cap('manage_links'); | |
} | |
add_action('init','modify_capabilities'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment