• Hey!

    Is it possible to add new role programmatically? With some PHP function?
    Maybe check if role already exists, if not, clone some existing role etc.

Viewing 1 replies (of 1 total)
  • Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi,

    Yes, it’s possible.

    
    add_role('new_role_id', 'New Role Name', array('read'=>'true'));
    

    Look in wp-includes folder at capabilities.php, class-wp-roles.php, class-wp-role.php for more information about related API available at WordPress core.

Viewing 1 replies (of 1 total)

The topic ‘Add new role programmatically’ is closed to new replies.