dozent_reviews_render( array $args = array(), bool $echo = true )

Query rating and reviews and render reviews list


Description

Get the courses reviews results by query from the database and render it. The results you can filter by passing $args value as array

Example usage:

dozent_reviews_render( array(
 'course_id' => 0,
 'user_id'   => 0,
 's'         => null, //Search term
 'rating'    => null,
 'status'    => 1,
 'start'     => 0,
 'per_page'     => 10 //per page
 ) );

Note: pass second parameter false if you like to return it instead of echo.

See also


Parameters

$args

(array) (Optional)

Default value: array()

$echo

(bool) (Optional)

Default value: true


Return

(mixed|void)


Source

File: includes/template-functions.php

	function dozent_reviews_render( $args = [], $echo = true ) {

		$reviews = dozent_get_course_reviews( $args );

		ob_start();
		dozent_load_template( 'partial/reviews', compact( 'reviews', 'args' ) );

		/**
		 * Filter the reviews which generated and located <code> partial/reviews.php </code> template
		 *
		 * @since DozentLMS 1.0.0
		 */

		$output = apply_filters( 'dozent_reviews_render', ob_get_clean(), $args );

		if ( $echo ) {
			echo $output;
		}

		return $output;

	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.