admin管理员组文章数量:1130349
I am working on a blog with a pretty high number of authors. I want to keep them from accidentally sending a push message to our readers, since the button of the push-plugin we use looks dangerously similar to the "publish"-button.
Is there a way to hide an element like this push-button for certain user groups by default?
I can uncheck it in the view-menu above the editor, of course, but that doesn't change it for all other authors.
I am working on a blog with a pretty high number of authors. I want to keep them from accidentally sending a push message to our readers, since the button of the push-plugin we use looks dangerously similar to the "publish"-button.
Is there a way to hide an element like this push-button for certain user groups by default?
I can uncheck it in the view-menu above the editor, of course, but that doesn't change it for all other authors.
Share Improve this question asked Nov 27, 2018 at 10:50 LaMigraLaMigra 31 bronze badge 2- Hide the content editor? – vikrant zilpe Commented Nov 27, 2018 at 10:57
- Our authors need the content editor to publish their posts. Additionally, they unfortunately have to be able to edit their posts later on. So hiding the whole editor is no option. – LaMigra Commented Nov 27, 2018 at 12:58
2 Answers
Reset to default 0Here are a couple options.
You could just create a stylesheet that loads in the admin area, and enable that for certain users if needed. Here is an example of loading a stylesheet in the admin for users with the role of "shopmanager".
function my_admin_styles(){
$user = wp_get_current_user();
if( ! empty($user) && count(array_intersect(["shop_manager"], (array) $user->roles ))) {
wp_enqueue_style(
'admin_css',
get_stylesheet_directory_uri() . '/css/admin-shopmanager.css', array(), filemtime( get_stylesheet_directory() . '/css/admin-shopmanager.css')
);
}
}
add_action('admin_enqueue_scripts', 'my_admin_styles');
Then in your stylesheet add something like this...
#elementID {
display: none !important;
}
You might also try a plugin called "Capability Manager Enhanced" which allows you to disable things based on user role.
I found a solution. It's more of a workaround because it utilizes a plugin but does what I've been looking for. I use the plugin Adminimize to hide the ID of the concerned field (which you can find out using Chromes or Firefox' inspector tools) for the usergroup 'Author'.
I am working on a blog with a pretty high number of authors. I want to keep them from accidentally sending a push message to our readers, since the button of the push-plugin we use looks dangerously similar to the "publish"-button.
Is there a way to hide an element like this push-button for certain user groups by default?
I can uncheck it in the view-menu above the editor, of course, but that doesn't change it for all other authors.
I am working on a blog with a pretty high number of authors. I want to keep them from accidentally sending a push message to our readers, since the button of the push-plugin we use looks dangerously similar to the "publish"-button.
Is there a way to hide an element like this push-button for certain user groups by default?
I can uncheck it in the view-menu above the editor, of course, but that doesn't change it for all other authors.
Share Improve this question asked Nov 27, 2018 at 10:50 LaMigraLaMigra 31 bronze badge 2- Hide the content editor? – vikrant zilpe Commented Nov 27, 2018 at 10:57
- Our authors need the content editor to publish their posts. Additionally, they unfortunately have to be able to edit their posts later on. So hiding the whole editor is no option. – LaMigra Commented Nov 27, 2018 at 12:58
2 Answers
Reset to default 0Here are a couple options.
You could just create a stylesheet that loads in the admin area, and enable that for certain users if needed. Here is an example of loading a stylesheet in the admin for users with the role of "shopmanager".
function my_admin_styles(){
$user = wp_get_current_user();
if( ! empty($user) && count(array_intersect(["shop_manager"], (array) $user->roles ))) {
wp_enqueue_style(
'admin_css',
get_stylesheet_directory_uri() . '/css/admin-shopmanager.css', array(), filemtime( get_stylesheet_directory() . '/css/admin-shopmanager.css')
);
}
}
add_action('admin_enqueue_scripts', 'my_admin_styles');
Then in your stylesheet add something like this...
#elementID {
display: none !important;
}
You might also try a plugin called "Capability Manager Enhanced" which allows you to disable things based on user role.
I found a solution. It's more of a workaround because it utilizes a plugin but does what I've been looking for. I use the plugin Adminimize to hide the ID of the concerned field (which you can find out using Chromes or Firefox' inspector tools) for the usergroup 'Author'.
本文标签: How to hide a field of the editor by default
版权声明:本文标题:How to hide a field of the editor by default 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749148268a2323372.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论