Admin user column sort by numeric meta key

Question

I try to sort a custom user field (team_user_id), I have all data but I can’t sort by numeric.

If ( isset($vars[‘orderby’] && ‘team_member_id’ === $var[‘orderby’] {

$vars = array_merge($vars, array(
‘meta_key’ => ‘team_member_id ‘,
‘orderby’ => ‘meta_value_num’
))
}

I tried in pre_get_post and request, but result is unsorted

0
, , David Sticker 1 year 2020-07-21T11:10:37-05:00 0 Answers 59 views 0

Leave an answer

Browse
Browse