| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for displaying instructor of course within the loop. |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/learnpress/loop/course/instructor.php. |
| 6 |
* |
| 7 |
* @author ThimPress |
| 8 |
* @package Learnpress/Templates |
| 9 |
* @version 4.0.1 |
| 10 |
*/ |
| 11 |
|
| 12 |
defined( 'ABSPATH' ) || exit(); |
| 13 |
|
| 14 |
$course = learn_press_get_course(); |
| 15 |
if ( ! $course ) { |
| 16 |
return; |
| 17 |
} |
| 18 |
|
| 19 |
$author_id = $course->get_author( 'id' ); |
| 20 |
$instructor = learn_press_get_user( $author_id ); |
| 21 |
if ( ! $instructor ) { |
| 22 |
return; |
| 23 |
} |
| 24 |
?> |
| 25 |
|
| 26 |
<div class="course-instructor"> |
| 27 |
<?php echo wp_kses_post( sprintf( '<a href="%s">%s</a>', $instructor->get_url_instructor(), $instructor->get_display_name() ) ); ?> |
| 28 |
</div> |
| 29 |
|