开发者 |
DrewAPicture
TrustedLogin |
---|---|
更新时间 | 2024年1月30日 11:36 |
捐献地址: | 去捐款 |
PHP版本: | 5.3 及以上 |
WordPress版本: | 6.4.2 |
Users lacking the chosen capability or role(s) will be redirected to the URL set in Settings > Dashboard Access.
The Toolbar contains certain important links (even for disallowed users) such as for accessing to the profile editor and/or logging out. Plus, there are many plugins out there for disabling the Toolbar if you really want to.
No. Disable the plugin if you don't wish to leverage the functionality.
rda_toolbar_nodes
(viewing from the admin), and rda_frontend_toolbar_nodes
(viewing from the front-end).<li>
container for the menu node you're targeting. It should take the form of <li id="wp-admin-bar-SOMETHING">
<li id="wp-admin-bar-SOMETHING">
, you want the "SOMETHING" part.The function returns an associative array with $pagenow
as the key and a nested array of key => value pairs where the key is the $_GET
parameter and the value is the allowed value.
Example: If you want to allow a URL of tools.php?page=EXAMPLE
, there are three parts to know:
$pagenow
global value (tools.php
in this case)$_GET
key (page
in this case)$_GET value (
EXAMPLE in this case)/** * Filter hidden Toolbar menus on the front-end. * * @param array $ids Toolbar menu IDs. * @return array Filtered front-end Toolbar menu IDs. */ function wpdocs_hide_some_toolbar_menu( $ids ) { $ids[] = 'SOMETHING'; return $ids; } add_filter( 'rda_frontend_toolbar_nodes', 'wpdocs_hide_some_toolbar_menu' ); Common plugin Toolbar menus and their ids:
To view debugging information on the Settings > Reading screen, visit:
example.com/options-general.php?page=dashboard-access&rda_debug=1
Yes! This plugin is in active development on GitHub. Pull requests are welcome!
Yes. The plugin does not collect any personal data, nor does it set any cookies.
rda_allowlist
, to configure pages that should be accessible to all users, regardless of their capabilities or roles (see FAQ for usage)ABSPATH
(#26)index.php
files in plugin directoriesscreen_icon()
warning$pagenow
global is not defined (#24)Invalid argument supplied for foreach()
PHP warning (#22)rda_default_caps_for_role
- Filter default roles for Admins, Editors, and Authorsrda_default_access_cap
- Change default access capabilityrda_toolbar_nodes
- Filter which back-end Toolbar nodes are hiddenrda_frontend_toolbar_nodes
- Filter which front-end Toolbar nodes are hidden