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 / CourseAuthorAvatarElementor.php

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

52 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class CourseAuthorAvatarElementor
4 *
5 * Dynamic course author avatar 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\Instructor\SingleInstructorTemplate;
14 use Elementor\Modules\DynamicTags\Module;
15
16 defined( 'ABSPATH' ) || exit;
17
18 class CourseAuthorAvatarElementor extends Tag {
19 use LPDynamicElementor;
20
21 public function __construct( array $data = [] ) {
22 $this->lp_dynamic_title = 'Course Author Avatar';
23 $this->lp_dynamic_name = 'course-author-avatar';
24 $this->lp_dynamic_categories = [ Module::TEXT_CATEGORY ];
25 parent::__construct( $data );
26 }
27
28 /**
29 * Render dynamic course author avatar elementor.
30 *
31 * @return void
32 */
33 public function render() {
34 $singleInstructorTemplate = SingleInstructorTemplate::instance();
35
36 try {
37 $course = $this->get_course_model();
38 if ( ! $course ) {
39 return;
40 }
41
42 $author = $course->get_author_model();
43 if ( ! $author ) {
44 return;
45 }
46 echo $singleInstructorTemplate->html_avatar( $author );
47 } catch ( \Throwable $e ) {
48 error_log( $e->getMessage() );
49 }
50 }
51 }
52