Last active
January 8, 2017 08:36
-
-
Save axxe16/a8c3d2fc31fda32df4552d6c1aa98d33 to your computer and use it in GitHub Desktop.
Clona le capabilities del ruolo amministratore e le attribuisce ad un ruolo custom che creo From http://wordpress.stackexchange.com/questions/31471/how-to-create-a-clone-role-in-wordpress
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
<?php | |
add_action('init', 'cloneRole'); | |
function cloneRole() | |
{ | |
global $wp_roles; | |
if ( ! isset( $wp_roles ) ) | |
$wp_roles = new WP_Roles(); | |
$adm = $wp_roles->get_role('administrator'); | |
//Adding a 'new_role' with all admin caps | |
$wp_roles->add_role('new_role', 'My Custom Role', $adm->capabilities); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment