Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // MEMBER ROLE
- if (isset($_GET['activated']) && is_admin()){
- add_action('init', 'member_role');
- }
- function member_role() {
- $result = add_role(
- 'member',
- __( 'Member' ),
- array(
- 'read' => true, // true allows this capability
- 'edit_posts' => false,
- '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.';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement