我想对非管理员用户隐藏“添加新页面”按钮。我成功地从右列隐藏了子菜单项,如下所示:
$page = remove_submenu_page( \'edit.php?post_type=page\', \'post-new.php?post_type=page\' );
我试图用本文中建议的css隐藏页面中的按钮question 但没有起作用。我如何才能做到这一点?以下是我的-失败-尝试:if (isset($_GET[\'post_type\']) && $_GET[\'post_type\'] == \'page\') {
echo \'<style type="text/css">
#favorite-actions, .add-new-h2, .tablenav { display:none; }
</style>\';
}