我的职能中有这一点。php
function remove_quick_edit( $actions ) {
unset($actions[\'inline hide-if-no-js\']);
return $actions;
}
add_filter(\'post_row_actions\',\'remove_quick_edit\',10,1);
滚动已发布帖子列表时,删除后端的快速编辑链接。
它就像一个符咒,但它甚至对管理员角色也会禁用它。有没有可能让它只显示给管理员,而其余的人仍在显示?谢谢
SOLVED thanks to jfacemyer!这是加载项函数的完整代码。php
function remove_quick_edit( $actions ) {
unset($actions[\'inline hide-if-no-js\']);
return $actions;
}
if ( ! current_user_can(\'manage_options\') ) {
add_filter(\'post_row_actions\',\'remove_quick_edit\',10,1);
}
SO网友:Zeh Ferrari
如果要从页面中删除“快速编辑”选项,请参阅以下代码:
function remove_quick_edit( $actions ) {
unset($actions[\'inline hide-if-no-js\']);
return $actions;
}
if ( !current_user_can(\'manage_options\') ) {
add_filter(\'page_row_actions\',\'remove_quick_edit\',10,1);
add_filter(\'post_row_actions\',\'remove_quick_edit\',10,1);
}