Skip to content

Instantly share code, notes, and snippets.

@mbejda
Last active December 28, 2015 02:49
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 mbejda/7430764 to your computer and use it in GitHub Desktop.
Save mbejda/7430764 to your computer and use it in GitHub Desktop.
<?php add_role( $role, $display_name, $capabilities ); ?>
<?php
$result = add_role('basic_contributor', 'Basic Contributor', array(
'read' => true, // True allows that capability
'edit_posts' => true,
'delete_posts' => false, // Use false to explicitly deny
));
if (null !== $result) {
echo 'Yay! New role created!';
} else {
echo 'Oh... the basic_contributor role already exists.';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment