How to remove capability from editors to access Content Blocks
-
Hi –
Thanks for the Content Blocks plugin!
We’re trying to remove some capabilities from the editor role, including the ability to edit, publish or delete Content Blocks.
Here is the code we’ve tried. It doesn’t work yet. Any suggestions, please?
function editor_remove_caps() { if( current_user_can( 'editor' ) ){ $role = get_role( 'editor' ); $role -> remove_cap( 'edit_content_block' ); // also tried 'edit_content_blocks' $role -> remove_cap( 'publish_content_block' ); // also tried 'publish_content_blocks' $role -> remove_cap( 'delete_content_block' ); }; }; add_action( 'admin_menu', 'editor_remove_caps' );
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to remove capability from editors to access Content Blocks’ is closed to new replies.