1
我的代碼如下,但返回的列表不按字母順序排序。如何從get_term_children按字母順序對id進行排序?
任何幫助?
<?php
$termID = 4;
$taxonomyName = "location";
$termchildren = get_term_children($termID, $taxonomyName);
echo '<ul class="list">';
foreach ($termchildren as $child) {
$term = get_term_by('id', $child, $taxonomyName);
echo '<li><span class="feature"><a href="' . get_term_link($term->name, $taxonomyName) . '">' . $term->name . '</a></li>';
}
echo '</ul>';
?>