要澄清Eric的帖子add_filter
代码需要具有screenid
在自定义post类型slug之前。最常见的生物bulk_actions-edit-custom_post_type_slug
.
而且unset( $actions[\'inline\'] )
似乎不是选项。
二者都unset( $actions[\'edit\'] )
和unset( $actions[\'trash\'] )
是我能找到的全部。
最后,此代码删除批量选项下拉菜单项,它不会删除;“快速编辑”;将鼠标悬停在帖子上时显示的选项。
function ssp_remove_member_bulk_actions( $actions, $post ){
unset( $actions[\'edit\'] );
return $actions;
}
add_filter(\'bulk_actions-edit-member\',\'ssp_remove_member_bulk_actions\', 10, 2);
THIS CODE Removes Quick Edit (thanks to jfacemyer)
function remove_quick_edit( $actions, $post ) {
unset($actions[\'inline hide-if-no-js\']);
return $actions;
}
add_filter(\'post_row_actions\',\'remove_quick_edit\',10,2);
You can also turn off:
<编辑=
unset($actions[\'edit\']);
垃圾=
unset($actions[\'trash\']);
查看=
unset($actions[\'view\']);
To remove everything from the Quick Edit hover options:
function remove_quick_edit( $actions, $post ) {
unset($actions[\'edit\']);
unset($actions[\'trash\']);
unset($actions[\'view\']);
unset($actions[\'inline hide-if-no-js\']);
return $actions;
}
add_filter(\'post_row_actions\',\'remove_quick_edit\',10,2);
最后,您只能删除基于自定义帖子类型甚至用户功能的操作:
// Based on Post Type
if ($post->post_type==\'myposttype\') {
unset($actions[\'edit\']);
}
// Based on User Capability
if ( current_user_can(\'manage_options\') ) {
unset($actions[\'edit\']);
}