<?php
use Elementor\Utils;
use Elementor\Plugin;
// Silence is golden.
    /**
     * Get all setting from elementor element panel.
     */
	$settings = $this->get_settings_for_display();
    $default_content_source_type = widgetkit_pro_array_get($settings, 'default_content_source');
    $default_content_source_elementor = widgetkit_pro_array_get($settings, 'default_content_source_elementor');
    $id = $this->get_id();

    if( class_exists('SFWD_LMS') ) :
        /**
         * check wheater it is elementor edit mode or not
         */
        $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();
        }
        /**
         * get the post content
         */
        $course = get_post($course_id);

        ?>
            <div class="learndash-course-content">
                <?php 
                    if('editor' == $default_content_source_type):
                        echo $course->post_content;
                    elseif( 'elementor-saved-template' == $default_content_source_type ): 
                        echo Plugin::$instance->frontend->get_builder_content($default_content_source_elementor, true);
                    endif;
                ?>
            </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;