dozent_get_all_course_categories( int $parent )

Get all course categories of Doent LMS


Description

See also


Parameters

$parent

(int) (Required)


Return

(array)


Source

File: includes/template-functions.php

	function dozent_get_all_course_categories( $parent = 0 ) {
		$args = apply_filters( 'dozent_get_all_course_categories_default_args', [
			'taxonomy'   => 'course_category',
			'hide_empty' => false,
			'parent'     => $parent,
		] );

		$terms = get_terms( $args );

		$children = array();
		foreach ( $terms as $term ) {
			$term->children             = dozent_get_all_course_categories( $term->term_id );
			$children[ $term->term_id ] = $term;
		}

		return $children;
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.