How to order a taxonomy's terms numerically, from lowest to highest using get_terms

wordpress.stackexchange https://wordpress.stackexchange.com/questions/24186

  •  30-10-2019
  •  | 
  •  

سؤال

I'm using get_terms to output a taxonomy's terms, which are all numbers:

For example:

4, 6, 8, 10, 12

How can I order these numerically, so they appear exactly as above?

What I'm getting is actually:

10, 12, 4, 6, 8

I can see why it's done this (thinks 10 is first because it starts with a 1) but how can I fix it?

I've tried all the ordering options on the codex for get_terms but can't seem to get them in order. Here's an example of what I have so far. I've even tried ordering by id and entering them in order but it still muddled it up.

$taxonomy_array = get_terms('taxonomy-name', 'hide_empty=0');

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى wordpress.stackexchange
scroll top