How To Create Custom User Role in Wordpress
<?php add_role( $role, $display_name,
$capabilities ); ?>
Example
:
add_role('basic_contributor', 'Basic Contributor', array(
'read' => true, // True allows that capability
'edit_posts' => true,
'delete_posts' => false, // Use false to explicitly deny
));
OR
add_role( 'custom_role', 'Custom Subscriber', array( 'read' => true, 'level_0' => true ) );
Note :- Use anyone from above code and paste it in function.php file in wordpress theme
which you can use.
No comments:
Post a Comment