start_controls_section( 'course_description_content', [ 'label' => __('General Settings', 'acadlix-addon-for-elementor'), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'course_description_html_tag', array( 'label' => esc_html__('Select Tag', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => array( 'h1' => esc_html('h1'), 'h2' => esc_html('h2'), 'h3' => esc_html('h3'), 'h4' => esc_html('h4'), 'h5' => esc_html('h5'), 'h6' => esc_html('h6'), ), 'default' => 'h2', ) ); $this->add_control( 'course_description_title', [ 'label' => __('Title', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::TEXTAREA, 'default' => __('Course Description:', 'acadlix-addon-for-elementor'), 'placeholder' => __('Type your title here', 'acadlix-addon-for-elementor'), 'rows' => 3, ] ); $this->add_control( 'course_description_title_display', [ 'label' => __('Show Title', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'acadlix-addon-for-elementor'), 'label_off' => __('Hide', 'acadlix-addon-for-elementor'), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_responsive_control( 'course_description_align', $this->aelms_alignment( array( '{{WRAPPER}}' => 'text-align: {{VALUE}};', ), ) ); $this->end_controls_section(); } protected function register_style_controls() { $label_selector = '{{WRAPPER}} .aelms-course-description-title'; $this->start_controls_section( 'course_description_label_style_section', [ 'label' => __('Label', 'acadlix-addon-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'course_description_label_color', [ 'label' => __('Color', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ $label_selector => 'color: {{VALUE}};', ], 'default' => '#161616', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'course_description_label_typography', 'label' => __('Typography', 'acadlix-addon-for-elementor'), 'selector' => $label_selector, ] ); $this->add_responsive_control( 'course_description_label_gap', array( 'label' => __('Gap', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => array('px'), 'range' => array( 'px' => array( 'min' => -100, 'max' => 100, ), ), 'selectors' => array( $label_selector => 'margin-bottom: {{SIZE}}{{UNIT}};', ), ) ); $this->end_controls_section(); $selector = '{{WRAPPER}} .aelms-course-description'; $this->start_controls_section( 'course_description_style_section', [ 'label' => __('Description', 'acadlix-addon-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'course_description_color', [ 'label' => __('Color', 'acadlix-addon-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ $selector => 'color: {{VALUE}};', ], 'default' => '#161616', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'course_description_typography', 'label' => __('Typography', 'acadlix-addon-for-elementor'), 'selector' => $selector, ] ); $this->end_controls_section(); } protected function render() { $course = aelms_get_course(); if ($course) { ob_start(); $settings = $this->get_settings_for_display(); include AELMS_PLUGIN_DIR . 'templates/course/description.php'; $html = ob_get_clean(); echo wp_kses_post($html); } } }