By default, only users with the Administrator or Editor roles can access the FlyingPress dashboard and its settings. You can customize this using the flying_press_allowed_roles
filter to add, remove, or limit access to specific user roles.
Where to add this code
Add the following code to:
Your theme’s
functions.php
fileA custom plugin
A plugin like Code Snippets
Example: Add more roles (e.g., Subscriber)
add_filter('flying_press_allowed_roles', function ($roles) {
$roles[] = 'subscriber';
return $roles;
});
This grants access to the FlyingPress dashboard for users with the subscriber
role in addition to the default roles.
Example: Restrict access to only selected roles
add_filter('flying_press_allowed_roles', function ($roles) {
return ['administrator']; // Only allow administrators
});
This removes access for all other roles, including editors.
Notes
The
$roles
array should contain valid WordPress role slugsThe filter fully replaces the allowed roles list, so make sure to include all roles you want to allow
Changes take effect immediately and apply across the admin area