aa lol, yesterday i made a code to do that in dashboard lol, but in fact i could simply like that ?? cf : Post support
so just in case if someone want the code to do a default sort directly in dashboard with shortcode :
add_filter( 'wp_table_reloaded_post_load_table', 'wp_table_reloaded_execute_shortcode_before_sort',10,2 );
add_filter( 'wp_table_reloaded_filter_sort_pre', 'wp_table_reloaded_execute_filter_sort_pre' );
add_filter( 'wp_table_reloaded_pre_save_table', 'wp_table_reloaded_before_save_sort',10,1 );
function wp_table_reloaded_before_save_sort( $table ) {
if(isset($table['data']) && isset($table['data_hash'])) {
foreach($table['data'] as $k => $v) {
$save_v = $v;
unset($v[5]);
$hash = md5(implode('-',$v));
$table['data'][$k][5] = $table['data_hash'][$hash];
}
}
return $table;
}
function wp_table_reloaded_execute_filter_sort_pre( $value ) {
return do_shortcode($value);
}
function wp_table_reloaded_execute_shortcode_before_sort($table,$table_id) {
if(isset($_POST['submit']['sort'])) {
if(isset($table['data'])){
$table['data_hash'] = array();
foreach($table['data'] as $k => $v) {
$vv = $v;
unset($vv[5]);
$table['data_hash'][md5(implode('-',$vv))] = $v[5];
$v[5] = apply_filters( 'wp_table_reloaded_filter_sort_pre', $v[5] );
$table['data'][$k] = $v;
}
}
}
return $table;
}