I get an Array from wordpress get_categories and i need to sort it with a value that is inside an ACF field. This value is composed like this : number | year , for example 2 | 2017
I need to sort with number (that can be 1, 2, 3...), this will determine my order rank.
To get my categories array i do :
$args = array( 'taxonomy' => 'category', 'hide_empty' => 0 ); $c = get_categories($args);
And i think i must add a for each after that with a usort but i don't know how to do. To get my ACF field i could do this:
And this to extract the number:
substr ( get_field('millesime', 'category_'.$cat->term_id),0,1)
But my problem is that i don't know how to make it work with USORT.
Thanks for help.