Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Create Custom User Role in Wordpress [closed]

Tags:

wordpress

I have to create a Reviewer (custom) role for users in WordPress , how can I create a custom rule ?

like image 387
Niraj Desai Avatar asked Oct 20 '12 05:10

Niraj Desai


1 Answers

You can use add role function like

<?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
));

Also see this tutorial (custom rule discussed) and this plugin too if you don't want to write any code.

like image 103
The Alpha Avatar answered Oct 11 '22 00:10

The Alpha