Documentation

Custom User Roles

Sometimes the default roles and capabilities aren’t exactly what you need for your site. If you need to create new roles or modify existing ones, we have a bunch of helper functions to assist you in doing this. Please use these functions rather than the traditional methods as this will ensure that your code works on WordPress.com and in your development environments.

As an example, here’s how you can register a “Comment Moderator” role:

wpcom_vip_add_role( 'comment_moderator', 'Comment Moderator', array( 'read' => true, 'edit_posts' => true, 'moderate_comments' => true ) );

Note: you’ll want to use these helper functions as soon as your theme executes. Hooking them into ‘after_setup_theme’ or ‘init’ will be too late.