tools/wordpress-user-role-generator
WordPress User Role Generator
The WordPress user role generator allows you to generate a custom user role for your WordPress website.
snippet.php
function register_user_role() {
add_role(
'author',
'Author',
array(
// Pick capabilities above, or add them here.
)
);
}
// add_role() returns early when the role already exists, so running this on
// every request is harmless. register_activation_hook() is the better home for
// it if this snippet lives in a plugin.
add_action( 'init', 'register_user_role' );