How to Create a Custom User Role in WordPress

PHOTO EMBED

Sat Nov 25 2023 07:38:52 GMT+0000 (Coordinated Universal Time)

Saved by @dmsearnbit

/* Create Staff Member User Role */
add_role(
    'staff_member', //  System name of the role.
    __( 'Staff Member'  ), // Display name of the role.
    array(
        'read'  => true,
        'delete_posts'  => true,
        'delete_published_posts' => true,
        'edit_posts'   => true,
        'publish_posts' => true,
        'upload_files'  => true,
        'edit_pages'  => true,
        'edit_published_pages'  =>  true,
        'publish_pages'  => true,
        'delete_published_pages' => false, // This user will NOT be able to  delete published pages.
    )
);
content_copyCOPY

https://speckyboy.com/creating-a-custom-user-role-in-wordpress/