Additional options for role is a special User Role Editor feature which allow to extend and customize its functionality for your own needs.
Imagine, for example, that you need to be capable to switch off front-end top admin menu bar for the selected role. Just select the role, scroll page down to the “Additional options” section and turn ON “Hide admin bar” checkbox:
Click “Update” button to save your changes. That’s it. While WordPress does not offer special user capability for this purpose it’s possible to manage the access to the top admin menu bar now.
What if you wish to add some option here yourself? It’s simple, but some knowledge of PHP and WordPress are required.
For example to add the 2nd option ‘Prohibit access to admin’ from the screenshot above it’s enough to add this code to your active theme functions.php:
'ure_role_additional_options' filter to add new option. Function
add_prohibit_access_to_admin_option() linked to the filter takes the list of available options as input parameter, adds 1 new option to it, and returns modified list.
URE_Role_Additional_Options::create_item() is used to create valid data structure for new option. Input parameters of this function are:
1) option ID (follow the rules for PHP identificators);
2) option label – any text, which will appear to the right of option checkbox;
3) WordPress hook (action) to which to link your option code.
4) Publicly available function name which will be called when named above WordPress hook fire.
So this way we may extend the list of permissions linked to the role much beyond built-in WordPress user capabilities. User Role Editor will store its values and link code to the correspondent hooks automatically.