Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove "Quick edit" option in "register_post_meta" list page

Tags:

php

wordpress

I am using register_post_type in list page automatically it is four actions Edit/Quick Edit/trash/View. I want to remove "Quick edit" option from list page. How I can do this.

like image 623
Hina Avatar asked Dec 12 '25 09:12

Hina


1 Answers

/*------------------------------------------------------------------------------------
    remove quick edit for custom post type videos just to check if less mem consumption
------------------------------------------------------------------------------------*/
add_filter( 'post_row_actions', 'remove_row_actions', 10, 2 );
function remove_row_actions( $actions, $post )
{
  global $current_screen;
    if( $current_screen->post_type != 'videos' ) return $actions;
    unset( $actions['edit'] );
    unset( $actions['view'] );
    unset( $actions['trash'] );
    unset( $actions['inline hide-if-no-js'] );
    //$actions['inline hide-if-no-js'] .= __( 'Quick Edit' );

    return $actions;
}

It worked for me check with yours

like image 117
Balaji Chandrasekaran Avatar answered Dec 13 '25 21:12

Balaji Chandrasekaran



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!