Custom User Role doesn’t appear in dropdown list of Author
-
Hi there,
I created a Custom User role using a plugin with the following code:
function sk_add_custom_roles_on_plugin_activation() { // Remove custom roles to update capabilities changes if( get_role('sk_guide') ){ remove_role( 'sk_guide' ); } add_role( 'sk_guide', __( 'NewAuthor' , 'sk-custom-user-role'), array( 'read' => true, // true allows this capability 'edit_published_posts' => true, 'upload_files' => true, 'publish_posts' => true, 'delete_published_posts' => true, 'edit_posts' => true, 'delete_posts' => true, ) ); } register_activation_hook( __FILE__, 'sk_add_custom_roles_on_plugin_activation' );
The new user has the same capabilities of Author.
Unfortunately when I attempt to change an Article author to one with my NewAuthor role it doesn’t appear in the list.
I found this solution https://stormconsultancy.co.uk/blog/development/bug-of-the-day/custom-roles-in-wordpress-not-appearing-in-author-lists/ but it’s very outdated.
Does anyone have an update or an alternative?
Thanks a lot,
Simone
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom User Role doesn’t appear in dropdown list of Author’ is closed to new replies.