Remove Dashboard Access WordPress 插件

Remove Dashboard Access WordPress 插件

描述

  • Limit Dashboard access to admins only, admins + editors, admins + editors + authors, or limit by specific capability.
  • Choose your own redirect URL
  • Optionally allow user profile access
  • Optionally display a message on the login screen
  • (more info)

Contribute to RDA

This plugin is in active development on GitHub. Pull requests are welcome!
Capabilities:

  • You can limit Dashboard access to Admins only, Editors or above, Authors or above, or by selecting a capability. More information on WordPress’ default roles and capabilities can be found here: https://codex.wordpress.org/Roles_and_Capabilities

User Profile Access:

  • You can optionally allow all users the ability to edit their profiles in the Dashboard. Users lacking the chosen capability won’t be able to access any other sections of the Dashboard.

Login Message:

  • Supply a message to display on the login screen. Leaving this blank disables the message.

Hiding other plugins/themes’ Toolbar menus:

  • Remove Dashboard Access removes some built-in WordPress Toolbar menus by default, but can be extended to hide menus from other plugins or themes via two filters: rda_toolbar_nodes (viewing from the admin), and rda_frontend_toolbar_nodes (viewing from the front-end).

How to find the menu (node) id:

  • In the HTML page source, look for the <li> container for the menu node you’re targeting. It should take the form of <li id="wp-admin-bar-SOMETHING">
  • In <li id="wp-admin-bar-SOMETHING">, you want the “SOMETHING” part.

How to filter the disallowed Toolbar nodes on the front-end:

/** * Filter hidden Toolbar menus on the front-end. * * @param array $ids Toolbar menu IDs. * @return array (maybe) 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:

  • Jetpack by WordPress.com (notifications) – ‘notes’
  • WordPress SEO by Yoast – ‘wpseo-menu’
  • W3 Total Cache – ‘w3tc’

Debug Mode

To view debugging information on the Settings > Reading screen, visit:

example.com/options-general.php?page=dashboard-access&rda_debug=1

相关推荐

发表回复

房先生
我们将24小时内回复。
2024-07-11 10:59:49
您好,有任何疑问请与我们联系!
您的工单我们已经收到,我们将会尽快跟您联系!
[QQ客服]
2781198
加我微信
[电话联系]
13585372227
[电子邮件]
chaoneo@163.com
取消

选择聊天工具: