是否有插件或方法可以限制或限制某个用户管理界面上的按钮?
例如:
对于具有作者角色的用户,他/她只能发布内容,其他按钮将停用。
是否有解决方案?
是否有插件或方法可以限制或限制某个用户管理界面上的按钮?
例如:
对于具有作者角色的用户,他/她只能发布内容,其他按钮将停用。
是否有解决方案?
查看Adminimize,它由德国著名插件作者FrankBueltge完成。Link
尝试以下操作:
// function to remove the Links menu item
function wpse_7192_remove_menus()
{
// setup the global menu variable
global $menu;
// this is an array of the menu item names we wish to remove
$restricted = array( __(\'Links\'));
end ($menu);
while (prev($menu))
{
$value = explode( \' \', $menu[key($menu)][0] );
if( in_array( $value[0] != NULL ? $value[0] : "" , $restricted ) )
{
unset( $menu[key($menu)] );
}
}
}
if(!current_user_can(\'edit_pages\'))
{
// hook into the action that creates the menu
add_action(\'admin_menu\', \'wpse_7192_remove_menus\');
}
这将删除所有人的链接菜单,但那些可以管理选项的人除外(我认为这是编辑器级别)。因此,只需按照相同的逻辑删除特定用户级别的所有必要菜单
Check out the post here for further details.
当我通过Appearance → Menus, 右侧的“菜单结构”完全缺失。所以我无法更新我的菜单。这个Pages 节,但没有“菜单结构”。有没有人看到这个或知道在这里该怎么做?
是否有插件或方法可以限制或限制某个用户管理界面上的按钮?
例如:
对于具有作者角色的用户,他/她只能发布内容,其他按钮将停用。
是否有解决方案?
查看Adminimize,它由德国著名插件作者FrankBueltge完成。Link
尝试以下操作:
// function to remove the Links menu item
function wpse_7192_remove_menus()
{
// setup the global menu variable
global $menu;
// this is an array of the menu item names we wish to remove
$restricted = array( __(\'Links\'));
end ($menu);
while (prev($menu))
{
$value = explode( \' \', $menu[key($menu)][0] );
if( in_array( $value[0] != NULL ? $value[0] : "" , $restricted ) )
{
unset( $menu[key($menu)] );
}
}
}
if(!current_user_can(\'edit_pages\'))
{
// hook into the action that creates the menu
add_action(\'admin_menu\', \'wpse_7192_remove_menus\');
}
这将删除所有人的链接菜单,但那些可以管理选项的人除外(我认为这是编辑器级别)。因此,只需按照相同的逻辑删除特定用户级别的所有必要菜单
Check out the post here for further details.
我在函数末尾添加以下代码。php文件,用于根据自定义帖子的帖子标题填充分类法。问题是,当我添加代码时,尝试登录wp admin时会出现以下错误。非常感谢您能帮助我们弄清楚为什么会发生这种情况。Error:错误:由于意外输出,Cookie被阻止。有关帮助,请参阅此文档或尝试支持论坛。Code: <?php function update_custom_terms($post_id) { // only update terms if