我在列表页中自动使用register_post_type
,它有四个操作:编辑/快速编辑/垃圾/查看。我想从列表页面中删除"快速编辑"选项。我怎么能做到这一点。
/*------------------------------------------------------------------------------------
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;
}
它对我有效,与您的进行了检查