Give admin_menu permission to specific users

To grant access to the menu for users with Editor role, in place of manage_options use publish_pages as the capability. To be able to guide you in the future, use the breakdown of capabilities listed in this page below. Pick a capability that is present only in the roles you’re targeting. https://wordpress.org/support/article/roles-and-capabilities/

Adding all custom capabilities to admin

What is the correct approach here? Should all custom caps be added to admin role manually like they are added to other roles? Yes, because register_post_type() will not automatically assign the capabilities to any users or user roles, including administrators, but if Multisite is enabled, then those who are super admins would always be able … Read more

Allow a user or role to view drafts and previews, but not other admin privileges?

Figured out an easier way. I gave them the edit_other_posts and edit_other_pages role capabilities, and then blocked their access to the admin area using the following: add_action( ‘init’, ‘eri_block_nonadmins_init’ ); function eri_block_nonadmins_init() { $current_url = eri_get_current_url( true, false); if ( (!current_user_can( ‘administrator’ ) && !( defined( ‘DOING_AJAX’ ) && DOING_AJAX )) && (is_admin() || $current_url … Read more