Change WordPress user roles and capabilities › Forums › New Feature Request › Custom backend CSS applied for custom role?
Tagged: admin menu item update
- This topic has 5 replies, 2 voices, and was last updated 7 years, 3 months ago by
Vladimir.
-
AuthorPosts
-
20/07/2018 at 04:24 #5036
hkunkun
ParticipantHi,
Can we create custom backend CSS that will be applied for custom logged in user role?
Thanks!
21/07/2018 at 02:37 #5037Vladimir
KeymasterYes, we can. There is a hook to add additional option for roles.
Code below adds “Add custom CSS” additional option. Custom CSS will be added to the backend for the selected role once you turn this option ON for it.add_filter('ure_role_additional_options', 'ure_custom_backend_css_option', 10, 1); function ure_custom_backend_css_option($items) { $item = URE_Role_Additional_Options::create_item('custom_backend_css', esc_html__('Add custom CSS', 'user-role-editor'), 'admin_init', 'ure_add_custom_backend_css'); $items[$item->id] = $item; return $items; } function ure_add_custom_backend_css() { add_action('admin_head', 'ure_custom_backend_css'); } function ure_custom_backend_css() { ?> <style> # URE custom CSS here </style> <?php }I set this code as a Must Use plugin for testing.
23/07/2018 at 09:35 #5041hkunkun
ParticipantThanks for the reply!
One more thing (sorry if it’s off topic), I can manage which admin menus are showing for a specific role, so can I also do a custom order for them too?
Many thanks.
23/07/2018 at 12:49 #5042Vladimir
KeymasterThere is no custom order functionality for admin menu in User Role Editor Pro.
Look at Admin menu editor plugin.24/07/2018 at 09:13 #5045hkunkun
ParticipantThanks for the reply.
I meet another problem, installing the new plugin that comes with an admin menu, but it’s not appeared in the “admin menu” list. (It appeared in the backend admin as I’m a super admin but not other roles).
I think is it the problem when User Role Editor haven’t update the admin menu item yet? And how to fix it?
Thanks.
24/07/2018 at 14:40 #5047Vladimir
KeymasterURE shows full admin menu for the ‘administrator’ role only. URE shows admin menu items to which selected role has access only – for all other roles.
Do you see mentioned menu item if you open “Admin menu” for the “administrator” role? Look what capability protects needed menu item there. It will appear at the “Admin menu” for other role after you will grant that capability to a role.
-
AuthorPosts
- You must be logged in to reply to this topic.