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

1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
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.