PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.3.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.3.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / inc / ExternalPlugin / Elementor / Widgets / Course / Dynamic / CourseCountLessonDynamicElementor.php

CourseCountLessonDynamicElementor.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.3.8, at inc/ExternalPlugin/Elementor/Widgets/Course/Dynamic/CourseCountLessonDynamicElementor.php

55 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class CourseCountLessonDynamicElementor
4 *
5 * Dynamic course count lesson elementor.
6 *
7 * @since 4.2.3.5
8 * @version 1.0.0
9 */
10 namespace LearnPress\ExternalPlugin\Elementor\Widgets\Course\Dynamic;
11 use Elementor\Core\DynamicTags\Tag;
12 use LearnPress\ExternalPlugin\Elementor\LPDynamicElementor;
13 use LearnPress\TemplateHooks\Course\SingleCourseTemplate;
14
15 defined( 'ABSPATH' ) || exit;
16
17 class CourseCountLessonDynamicElementor extends Tag {
18 use LPDynamicElementor;
19
20 /**
21 * Declare base properties for dynamic course elementor
22 *
23 * @param array $data
24 */
25 public function __construct( array $data = [] ) {
26 $this->lp_dynamic_title = 'Course Count Lesson';
27 $this->lp_dynamic_name = 'course-count-lesson';
28 parent::__construct( $data );
29 }
30
31 /**
32 * Render dynamic course count lesson elementor.
33 *
34 * @return void
35 */
36 public function render() {
37 $singleCourseTemplate = SingleCourseTemplate::instance();
38
39 try {
40 $course = $this->get_course_model();
41 if ( ! $course ) {
42 return;
43 }
44
45 if ( $course->is_offline() ) {
46 return;
47 }
48
49 echo $singleCourseTemplate->html_count_item( $course, LP_LESSON_CPT );
50 } catch ( \Throwable $e ) {
51 error_log( $e->getMessage() );
52 }
53 }
54 }
55