dozent_course_levels( null $level = null )

Get all course levels available in the Dozent LMS


Description

Example usage:

$levels = dozent_course_levels();

Parameters

$level

(null) (Optional)

Default value: null


Return

(mixed|string|void)


Source

File: includes/core-functions.php

	function dozent_course_levels( $level = null ) {

		/**
		 * Filter the course levels
		 *
		 * @since DozentLMS 1.0.0
		 *
		 * @param array $array
		 */

		$levels = apply_filters( 'dozent_course_levels', [
			'all'          => __( 'All Levels', 'dozent' ),
			'beginner'     => __( 'Beginner', 'dozent' ),
			'intermediate' => __( 'Intermediate', 'dozent' ),
			'expert'       => __( 'Expert', 'dozent' ),
		] );

		if ( $level ) {
			if ( isset( $levels[ $level ] ) ) {
				return $levels[ $level ];
			} else {
				return '';
			}
		}

		return $levels;
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.