Wordpress - What features are needed to view messages planned in the future by someone else?

So, I am trying to create several user roles in my theme to fit the user requirements of the site.

The first and simplest, which is an "external viewer", which I just want to be able to view the messages (both built-in and custom post-types) that someone from the content team created and planned at some point in the future.

I tried this first

$viewer_capabilities = array( 'read_private_pages' => true, 'read_private_posts' => true, 'read' => true ); add_role('external_viewer', 'External Viewer', $viewer_capabilities ); 

But when I logged in to /wp-admin I received a message "without permission", and I could not do anything. If I went to one of the planned posts, I just got "not found".

So i tried

 $role_object = get_role( 'external_viewer' ); $role_object->add_cap( 'read_private_pages' ); $role_object->add_cap( 'read_private_posts' ); $role_object->add_cap( 'read' ); 

Which took me a little further. I can log in and see the admin control panel, but if I visit a scheduled message, I still get a "page not found".

Can anyone see what I am missing?

+4
source share
1 answer

I believe the features you want are a combination of edit_private_pages , edit_private_posts , edit_published_posts , edit_published_pages , delete_published_pages and delete_published_posts . These names are explanatory.

+1
source

All Articles