• Hello,

    I’m currently developing a WordPress plugin in PHP with new custom user roles and custom capabilities.

    Because my plugin creates menu pages, I would like users with the “read” capability to be able to access the wp-admin page (Dashboard).

    However, when I try to do so, I only get a blank page with the message “Sorry, you are not allowed to access this page.”.

    One common suggestion when googling that issue is using a different version of PHP, but this doesn’t change anything, whenever I’m using PHP 7.x or 8.x.

    Best regards.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    To see the dashboard, the user needs a capability related to one of the widgets on it.

    Try giving them ‘view_site_health_checks’ capability. Or create a custom widget with appropriate capability. Or peruse /wp-admin/includes/dashboard.php looking for current_user_can calls for other possibilities of widgets you’re willing to give them access to.

Viewing 1 replies (of 1 total)
  • The topic ‘Users with “read” capabilities to access wp-admin’ is closed to new replies.