dozent_curriculum_content( null $single_curriculum = null, bool $echo = true )

Display the course single curriculum content


Description

Curriculum (aka Course Content Item) could be single lecture, single quiz or single assignments. Course curriculum always will be under course section. And each item will be each curriculum

Example usage:

dozent_curriculum_content();
dozent_curriculum_content( $curriculum_id );

See also


Parameters

$single_curriculum

(null) (Optional)

Default value: null

$echo

(bool) (Optional)

Default value: true


Return

(mixed|void)


Source

File: includes/template-functions.php

	function dozent_curriculum_content( $single_curriculum = null, $echo = true ) {
		global $post;

		$post = get_post( $single_curriculum );
		$course_id = dozent_get_course_id_by_content( $post );

		/**
		 * Filter default curriculum lock status, single curriculum pre content.
		 *
		 * If this filter return something that's not false, null, or empty, then the return value will be print in the curriculum content area.
		 * This filter useful for make integration that required to lock curriculum content based on condition.
		 * Default usage to check if proper access permission has based on the course price time.
		 *
		 * @since DozentLMS 1.0.0
		 *
		 * @param  bool false False Return
		 * @param  object  $post  Curriculum / course content Object
		 * @param  int  $course_id  Course ID
		 */

		$output = apply_filters( 'dozent_is_curriculum_locked', false, $post, $course_id );

		if ( ! $output ) {
			ob_start();

			setup_postdata( $post );

			$post_type = $post->post_type;
			$tmpl_dir = str_replace( 'dozent_', '', $post_type );

			/**
			 * Filter Curriculum item content template path
             *
             * Curriculum content could be lecture,quiz,assignment
             *
             * @since DozentLMS 1.0.0
             *
             * @param string $path Content Template Path
             * @param string $post_type Current Post Type
             * @param object $post_type Current Post Object
			 */

			$template = apply_filters( 'dozent_curriculum_content_template', "single/{$tmpl_dir}/content", $post_type, $post );

			dozent_load_template( $template, compact( 'post' ) );
			wp_reset_postdata();

			$output = apply_filters( "single/{$post_type}/content", ob_get_clean(), $post );
		}

		if ( $echo ) {
			echo $output;
		}

		return $output;
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.