📜  使 posts_custom_column 可排序 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:36.247000             🧑  作者: Mango

代码示例1
add_filter( 'manage_edit-cake_sortable_columns', 'my_sortable_cake_column' );
function my_sortable_cake_column( $columns ) {
    $columns['slices'] = 'slice';
 
    //To make a column 'un-sortable' remove it from the array
    //unset($columns['date']);
 
    return $columns;
}