add-to-cart-edd.php
3 years ago
add-to-cart-woocommerce.php
3 years ago
course-author.php
3 years ago
course-continue.php
3 years ago
course-in-cart.php
3 years ago
course-price-edd.php
3 years ago
course-price-woocommerce.php
3 years ago
course-price.php
3 years ago
course.php
3 years ago
end_content_wrap.php
3 years ago
enrolled-course-progress.php
3 years ago
footer.php
3 years ago
header.php
3 years ago
loop-after-content.php
3 years ago
loop-before-content.php
3 years ago
loop-end.php
3 years ago
loop-start.php
3 years ago
meta.php
3 years ago
rating.php
3 years ago
start_content_wrap.php
3 years ago
thumbnail.php
3 years ago
title.php
3 years ago
rating.php
42 lines
| 1 | <?php |
| 2 | /** |
| 3 | * A single course loop rating |
| 4 | * |
| 5 | * @package Tutor\Templates |
| 6 | * @subpackage CourseLoopPart |
| 7 | * @author Themeum <support@themeum.com> |
| 8 | * @link https://themeum.com |
| 9 | * @since 1.4.3 |
| 10 | */ |
| 11 | |
| 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | exit; |
| 14 | } |
| 15 | |
| 16 | $class = isset( $class ) ? ' ' . $class : ' tutor-mb-8'; |
| 17 | $show_course_ratings = apply_filters( 'tutor_show_course_ratings', true, get_the_ID() ); |
| 18 | ?> |
| 19 | |
| 20 | <div class="tutor-course-ratings<?php echo esc_html( $class ); ?>"> |
| 21 | <?php if ( $show_course_ratings ) : ?> |
| 22 | <div class="tutor-ratings"> |
| 23 | <div class="tutor-ratings-stars"> |
| 24 | <?php |
| 25 | $course_rating = tutor_utils()->get_course_rating(); |
| 26 | tutor_utils()->star_rating_generator_course( $course_rating->rating_avg ); |
| 27 | ?> |
| 28 | </div> |
| 29 | |
| 30 | <?php if ( $course_rating->rating_avg > 0 ) : ?> |
| 31 | <div class="tutor-ratings-average"> |
| 32 | <?php echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) ); ?> |
| 33 | </div> |
| 34 | <div class="tutor-ratings-count"> |
| 35 | (<?php echo esc_html( $course_rating->rating_count > 0 ? $course_rating->rating_count : 0 ); ?>) |
| 36 | </div> |
| 37 | <?php endif; ?> |
| 38 | </div> |
| 39 | <?php endif; ?> |
| 40 | </div> |
| 41 | <?php do_action( 'tutor_after_course_loop_rating', get_the_ID() ); ?> |
| 42 |