<?php
// Silence is golden.

	$settings = $this->get_settings_for_display();
    $id = $this->get_id();

    if( class_exists('SFWD_LMS') ) :
        $elementor_editor = \Elementor\Plugin::instance()->editor->is_edit_mode();
        if( $elementor_editor ) {
            $course_id = learndash_post_arr()[0];
        } else {
            $course_id = learndash_get_course_id();
        }
        
        $course = get_post($course_id);
        $user_id = $course->post_author;

        ?>
            <div class="learndash-course-instructor">
                <?php if( $settings['section_title'] ):  ?>
                    <h4> <?php echo esc_html($settings['section_title']); ?> </h4>
                <?php endif;  ?>
                <div class="course-author">
                    <div class="author-image">
                        <?php echo get_avatar( $user_id,50, '', ''); ?>
                    </div>
                    <div class="author-name"><?php echo esc_html( get_the_author_meta( 'display_name', $user_id ) ); ?></div>
                </div>
                <div class="course-author-description">
                    <?php echo esc_html( get_the_author_meta( 'description', $user_id ) ); ?>
                </div>
            </div>
    <?php
        else :
    ?>
        <div class="plugin-active-massage">
            <h3><?php esc_html_e('Please activate LearnDash LMS plugin first', 'widgetkit-pro');?></h3>
        </div>
    <?php endif;