To clarify on Eric's post the add_filter
code needs to have the screenid
before the custom post type slug. The most common being bulk_actions-edit-custom_post_type_slug
.
Also, unset( $actions['inline'] )
does not appear to be an option.
Both unset( $actions['edit'] )
and unset( $actions['trash'] )
were all I could find.
Finally, this code removes the Bulk Options Drop Menu Items, it does not remove the "Quick Edit" option which appears while hovering over a post.
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:
- edit =
unset($actions['edit']);
- trash =
unset($actions['trash']);
- view =
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);
Finally, you can only remove actions based on a Custom Post Type, or even user capabilities:
// 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']);
}