Home > Dev > WordPress Customization > Adding Custom User Roles

Adding Custom User Roles

This code will create a custom user role called “Event Manager.”

// Add this to your theme's functions.php file

function add_custom_user_role() {
    add_role('event_manager', __('Event Manager'), array(
        'read'         => true,
        'edit_posts'   => true,
        'delete_posts' => false
    ));
}
add_action('init', 'add_custom_user_role');
Back