Skip to content

Instantly share code, notes, and snippets.

@axxe16
Last active January 8, 2017 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axxe16/a8c3d2fc31fda32df4552d6c1aa98d33 to your computer and use it in GitHub Desktop.
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
<?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