PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.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
← All changes | templates/single-course/meta/instructor.php +23 -5 4.2.04.4.8 View file →
@@ -1,26 +1,44 @@
1 1 <?php
2 2 /**
3 3 * Template for displaying course instructor in primary-meta section.
4 4 *
5 - * @version 4.0.0
5 + * @version 4.0.2
6 6 * @author ThimPress
7 7 * @package LearnPress/Templates
8 8 */
9 9
10 +use LearnPress\Models\CourseModel;
11 +use LearnPress\TemplateHooks\Instructor\SingleInstructorTemplate;
12 +
10 13 defined( 'ABSPATH' ) || exit;
11 14
12 -$course = learn_press_get_course();
13 -if ( ! $course ) {
15 +$courseModel = CourseModel::find( get_the_ID(), true );
16 +if ( ! $courseModel ) {
14 17 return;
15 18 }
19 +
20 +$instructor = $courseModel->get_author_model();
21 +if ( ! $instructor ) {
22 + return;
23 +}
16 24 ?>
17 25
18 26 <div class="meta-item meta-item-instructor">
19 27 <div class="meta-item__image">
20 - <?php echo wp_kses_post( $course->get_instructor()->get_profile_picture() ); ?>
28 + <?php echo wp_kses_post( SingleInstructorTemplate::instance()->html_avatar( $instructor ) ); ?>
21 29 </div>
22 30 <div class="meta-item__value">
23 31 <label><?php esc_html_e( 'Instructor', 'learnpress' ); ?></label>
24 - <div><?php echo wp_kses_post( $course->get_instructor_html() ); ?></div>
32 + <div>
33 + <?php
34 + echo wp_kses_post(
35 + sprintf(
36 + '<a href="%s">%s</a>',
37 + $instructor->get_url_instructor(),
38 + SingleInstructorTemplate::instance()->html_display_name( $instructor )
39 + )
40 + );
41 + ?>
42 + </div>
25 43 </div>
26 44 </div>