0

I have this in my functions.php (child theme)

//Add capabilities to author, so he/she can edit...    
 function add_theme_caps() {
    // gets the author role
    $role = get_role( 'author' );
    $role->add_cap( 'edit_pages' );
    $role->add_cap( 'edit_published_pages' );
    $role->add_cap( 'edit_posts' ); 
    $role->add_cap( 'edit_others_posts' );  
    $role->add_cap( 'publish_posts' );  
    $role->add_cap( 'publish_pages' );  
    $role->add_cap( 'edit_published_posts' );   
    $role->add_cap( 'edit_published_pages' );       
}
add_action( 'admin_init', 'add_theme_caps');

but when I log in as an author the author is not able to edit pages (that admin has created) why? It's possible for the logged in author to view the pages, but not to edit and save anything.

1

It was a simple thing when thinking of it... I needed to add:

$role->add_cap( 'edit_others_pages ' );
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.