_dozent_get_course( null $post = null )

Get dozent Course Post Object


Description

This function is for internal use

See also


Parameters

$post

(null) (Optional)

Default value: null


Return

(array|WP_Post|null|DozentCourse)


Source

File: includes/course-functions.php

	function _dozent_get_course( $post = null ) {

		if ( $post instanceof \Dozent\Course ){
			return $post;
		}

		$post = get_post( $post );

		if ( $post->post_type === 'dozent_course' ){
			return $post;
		}

		if ( $post->post_type === 'dozent_lecture' || $post->post_type === 'dozent_quiz'
		     || $post->post_type === 'dozent_assignment' ) {

			$course_id = dozent_get_course_id_by_content( $post );

			return get_post( $course_id );
		}

		return null;

	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.