Course::start_uri( null $user = null )

Return the start course URL sequently


Parameters

$user

(null) (Optional)

Default value: null


Return

(false|string|null)


Source

File: classes/Course.php

	public function start_uri( $user = null ) {
		$contents = $this->get_contents();

		if ( ! dozent_count( $contents ) ) {
			return null;
		}

		$content_item = dozent_array_get( 0, $contents );

		if ( $this->is_public() || $this->is_protected() ) {
			return get_the_permalink( $content_item );
		}

		$completed_content_ids = $this->completed_content_ids( $user );

		foreach ( $contents as $content ) {
			if ( ! in_array( $content->ID, $completed_content_ids ) ) {
				$content_item = $content;
				break;
			}
		}

		return get_the_permalink( $content_item );
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.