Filter by numeric field
-
Hello,
I was trying to filter post items by column, that uses a numeric ACF field and found a bug. Filtering by numeric field caused 10 appearing before 2, 31 before 4 etc.
I’ve made a change in
acf_admin_columns.php
when setting:$query->set('orderby', 'meta_value');
to:if($query->query['orderby'] == 'acf_nights_hidden') { $query->set('orderby', 'meta_value_num'); } else { $query->set('orderby', 'meta_value'); }
where
nights_hidden
is my acf numeric field name. It helps in my case but I think it could be great if you can fix it generally :).Best,
Sebastian.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Filter by numeric field’ is closed to new replies.