dozent_ratings_and_reviews( int $course_ID, bool $echo = true )

Get the single course ratings and reviews section


Description

Example usage:

 //In the template

dozent_ratings_and_reviews();
dozent_ratings_and_reviews( $course_ID );

See also


Parameters

$course_ID

(int) (Required) Course ID

$echo

(bool) (Optional) should echo or return.

Default value: true


Return

(mixed|void)


Source

File: includes/template-functions.php

	function dozent_ratings_and_reviews( $course_ID = 0, $echo = true ) {

		$course_ID = dozent_get_post_id( $course_ID );
		$per_page = dozent_get_option( 'pagination_per_page', 10 );

		$course_rating = dozent_get_course_ratings( $course_ID );
		$total_reviews = (int) dozent_array_get( 'rating_count', $course_rating );

		if ( $total_reviews ) {
			ob_start();
			dozent_load_template( 'single/course/ratings_and_reviews', compact( 'course_ID', 'course_rating', 'per_page' ) );
			$html = ob_get_clean();
		} else {
			$html = '';
		}

		/**
		 * Filter the ratings and reviews output
		 *
		 * @since DozentLMS 1.0.0
		 *
		 * @param  string  $html  HTML Out Put
		 * @param  int  $course_ID  Course ID
		 */

		$output = apply_filters( 'dozent_ratings_and_reviews', $html, $course_ID );

		if ( $echo ) {
			echo $output;
		}

		return $output;
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.