I make a custom field "term_order" in wp_terms and i make a functionality to re-order the custom taxonomy. When i drag and drop the terms it save the re-order in "term_order" field successfully, but when i write and execute the "orderby => term_order" query it does not work.
Here is my code:
<?php
$foo_parent_ID = 0;
$foo_args = array(
'orderby' => 'term_order',
'order' => 'ASC',
'hide_empty' => false,
'parent' => $foo_parent_ID
);
$foo_terms = get_terms('foo_cat', $foo_args);
if($foo_terms){
?>
<ul id="foo_order_sortable" class="foo_admin_order">
<?php
foreach($foo_terms as $foo_term) :
?>
<li id="foo_parent_id_<?php echo $foo_term->term_id; ?>" class="lineitem <?php echo ($i % 2 == 0 ? 'alternate ' : ''); ?>ui-state-default">
<?php echo $foo_term->name.' _ id='.$foo_term->term_id.' ==> order-'.$foo_term->term_order; ?>
</li>
<?php
endforeach;
?>
</ul>
It shows me orderby Id, where is the mistake i dont understand.