下面是我用来创建和生成数据可排序列的代码。这些数据字段由高级自定义字段创建。即使日期显示在一个“";Ymd“;总体安排有人能帮我把日期正确地分类吗?
//Add custom column to user list
function new_modify_user_table( $column ) {
$column[\'school_name\'] = \'School Name\';
$column[\'shopping_start_date\'] = \'Start Date\';
$column[\'shopping_end_date\'] = \'End Date\';
return $column;
}
add_filter( \'manage_users_columns\', \'new_modify_user_table\' );
function new_modify_user_table_row( $val, $column_name, $user_id ) {
switch ($column_name) {
case \'school_name\' :
return get_the_author_meta( \'school_name\', $user_id );
case \'shopping_start_date\' :
return get_the_author_meta( \'shopping_start_date\', $user_id );
case \'shopping_end_date\' :
return get_the_author_meta( \'shopping_end_date\', $user_id );
default:
}
return $val;
}
add_filter( \'manage_users_custom_column\', \'new_modify_user_table_row\', 10, 3 );
function wpse_user_table_list_sortable_columns($columns) {
$columns[\'school_name\'] = \'school_name\';
$columns[\'shopping_start_date\'] = \'shopping_start_date\';
$columns[\'shopping_end_date\'] = \'shopping_end_date\';
return $columns;
}
add_filter(\'manage_users_sortable_columns\', \'wpse_user_table_list_sortable_columns\');