WordPress - 允许编辑者管理主题小部件

发布于 2024-08-13 17:23:38 字数 61 浏览 1 评论 0原文

是否可以授予编辑者管理主题小部件的能力?默认情况下,只有管理员可以执行此操作。

谢谢, 乔恩

Is it possible to grant Editors the ability to manage theme widgets? By default, only Administrators can do so.

Thanks,
Jon

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

柒七 2024-08-20 17:23:38

如果您不想使用插件,您也可以将其添加到您的functions.php或类似的地方。

$role = get_role('editor');
$role->add_cap('edit_theme_options');

If you don't want to use a plugin, you can also add this to your functions.php or somewhere similar.

$role = get_role('editor');
$role->add_cap('edit_theme_options');
行雁书 2024-08-20 17:23:38

I'm afraid you're going to need to use a plugin to achieve this, since changing Widgets is a switch_themes capability not available to Editors. You need a plugin that changes roles and capabilities (like Capability Manager). Check a similiar topic about this issue in Wordpress Forums.

酒几许 2024-08-20 17:23:38

在 WordPress 3.2.1 中,该功能为 edit_theme_optionsswitch_themes 只会让您激活与可用主题不同的主题。

In WordPress 3.2.1 the capability is edit_theme_options. switch_themes will do nothing more than allow you to activate a different theme from the available ones.

冬天的雪花 2024-08-20 17:23:38

是的,有几种方法可以做到这一点。如果您不想弄乱代码,您可以使用名为管理菜单编辑器的插件,该插件将为编辑器角色提供对小部件和主题选项的访问权限。对我来说不幸的是 wp 将对小部件的访问与对主题选项的访问捆绑在一起。为了解决这个问题,您可以安装另一个名为 Adminize 的插件,它将为您提供隐藏菜单中内容的选项。

第二种解决方案是使用functions.php 中的代码

$role = get_role('editor');
$role->add_cap('edit_theme_options');

,然后安装Adminize 来隐藏诸如主题选项之类的内容(如果您只想为管理员创建小部件访问权限)。

Yes there are several ways to this. If you don't want to mess with the code you can use a plugin called admin menu editor which will give Editor role access to the widgets and theme options. The unfortunate part for me is the wp bundled up access to widgets with access to theme options. To solve this you install another plugin called Adminize which will give you options to hide stuff from the menu.

The second solution is to use the code in the functions.php

$role = get_role('editor');
$role->add_cap('edit_theme_options');

and then install Adminize to hide stuff like theme-options if you only want to create widget access for your admin.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文