ap_sub_category_list( int $parent_id )
Description #
Display sub categories list.
Parameters #
- $parent_idint (Required) Parent id.
Source #
File: includes/taxo.php
function ap_sub_category_list( $parent_id ) {
$categories = get_terms(
array(
'taxonomy' => 'question_category',
'parent' => $parent_id,
'hide_empty' => false,
)
);
if ( $categories ) {
echo '<ul class="ap-category-subitems ap-ul-inline clearfix">';
foreach ( $categories as $cat ) {
echo '<li><a href="' . esc_url( get_category_link( $cat ) ) . '">' . esc_html( $cat->name ) . '<span>(' . (int) $cat->count . ')</span></a></li>';
}
echo '</ul>';
}
}
Expand full source code Collapse full source code View on GitHub: includes/taxo.php:108
Add your comment