0

I have found this thread about the same thing: Remove quick edit for custom post type But I only managed to remove the Bulk edit option with this.

What I want to do is to hide/remove Quick edit from a custom post type?

How do I manage this?

1 Answer 1

2

You can add a filter to the hook named post_row_actions.

Here's a sample code: (make sure to replace my-cpt with the actual post type name)

add_filter( 'post_row_actions', 'my_cpt_row_actions', 10, 2 );
function my_cpt_row_actions( $actions, $post ) {
    if ( 'my-cpt' === $post->post_type ) {
        // Removes the "Quick Edit" action.
        unset( $actions['inline hide-if-no-js'] );
    }
    return $actions;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.