start_controls_section( 'hero_title', [ 'label' => esc_html__( 'Thinkai Hero Title', 'thinkai' ), ] ); //General Align $this->add_responsive_control( 'general_align', [ 'label' => esc_html__( 'Alignment', 'thinkai' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'thinkai' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'thinkai' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'thinkai' ), 'icon' => 'eicon-text-align-right', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .thinkai-title-section' => 'text-align: {{VALUE}};' ], ] ); $this->add_control( 'subtitle_show', [ 'label' => esc_html__( 'Enable Small Title', 'thinkai' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'On', 'thinkai' ), 'label_off' => esc_html__( 'Off', 'thinkai' ), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'subtitle', [ 'label' => esc_html__( 'Small Title', 'thinkai' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => esc_html__( 'Enter your small title', 'thinkai' ), 'default' => esc_html__( 'Add Your Sub Heading Text Here', 'thinkai' ), 'condition' => [ 'subtitle_show' => 'yes' ] ] ); $this->add_control( 'small_title_tag', [ 'label' => esc_html__( 'Small Title HTML Tag', 'thinkai' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'span' => 'span', 'p' => 'p', ], 'default' => 'h4', 'condition' => [ 'subtitle_show' => 'yes' ] ] ); $this->add_control( 'title_show', [ 'label' => esc_html__( 'Enable Title', 'thinkai' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'On', 'thinkai' ), 'label_off' => esc_html__( 'Off', 'thinkai' ), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'title', [ 'label' => esc_html__( 'Title', 'thinkai' ), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, 'placeholder' => esc_html__( 'Enter your title', 'thinkai' ), 'default' => esc_html__( 'Add Your Heading Text Here', 'thinkai' ), 'condition' => [ 'title_show' => 'yes' ] ] ); $this->add_control( 'title_size', [ 'label' => esc_html__( 'Size', 'thinkai' ), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => esc_html__( 'Default', 'thinkai' ), 'small' => esc_html__( 'Small', 'thinkai' ), 'medium' => esc_html__( 'Medium', 'thinkai' ), 'large' => esc_html__( 'Large', 'thinkai' ), 'xl' => esc_html__( 'XL', 'thinkai' ), 'xxl' => esc_html__( 'XXL', 'thinkai' ), ], 'condition' => [ 'title_show' => 'yes' ] ] ); $this->add_control( 'title_tag', [ 'label' => esc_html__( 'Title HTML Tag', 'thinkai' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'span' => 'span', 'p' => 'p', ], 'default' => 'h2', 'condition' => [ 'title_show' => 'yes' ] ] ); $this->add_control( 'text_show', [ 'label' => esc_html__( 'Enable Text', 'thinkai' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'On', 'thinkai' ), 'label_off' => esc_html__( 'Off', 'thinkai' ), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'text', [ 'label' => esc_html__( 'Text', 'thinkai' ), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, 'placeholder' => esc_html__( 'Enter your Text', 'thinkai' ), 'default' => esc_html__( 'There are many variations of passages of lorem ipsum available the majority have suffered alteration in some form by injected humour. Duis aute irure dolor lipsum is simply free text available in the local markets in reprehenderit.', 'thinkai' ), 'condition' => [ 'text_show' => 'yes' ] ] ); $this->end_controls_section(); //General Style $this->start_controls_section( 'general_style', [ 'label' => esc_html__( 'General Setting', 'thinkai' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'general_margin', [ 'label' => esc_html__( 'Margin', 'thinkai' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .thinkai-title-section' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ], 'separator' => 'before', ] ); $this->add_responsive_control( 'general_padding', [ 'label' => esc_html__( 'Padding', 'thinkai' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .thinkai-title-section' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ], 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'general_bgtype', 'label' => __( 'Background', 'thinkai' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .thinkai-title-section', ] ); $this->end_controls_section(); //Small Title Style $this->start_controls_section( 'small_title_style', [ 'label' => esc_html__( 'Small Title Style Settings', 'thinkai' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'small_title__margin', [ 'label' => esc_html__( 'Margin', 'thinkai' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .te-subtitle' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ], 'separator' => 'before', ] ); $this->add_responsive_control( 'small_title_padding', [ 'label' => esc_html__( 'Padding', 'thinkai' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .te-subtitle' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ], 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'small_title_bgtype', 'label' => __( 'Background', 'thinkai' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .te-subtitle', ] ); $this->add_control( 'small_title_color', [ 'label' => esc_html__( 'Text Color', 'thinkai' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .te-subtitle' => 'color: {{VALUE}} !important;', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'small_title_typography', 'label' => __('Typography', 'thinkai'), 'selector' => '{{WRAPPER}} .te-subtitle', ] ); $this->add_group_control( Group_Control_Text_Stroke::get_type(), [ 'name' => 'small_title_text_stroke', 'selector' => '{{WRAPPER}} .te-subtitle', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'small_title_text_shadow', 'selector' => '{{WRAPPER}} .te-subtitle', ] ); $this->end_controls_section(); //Title Style $this->start_controls_section( 'title_style', [ 'label' => esc_html__( 'Title Style Settings', 'thinkai' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'title__margin', [ 'label' => esc_html__( 'Margin', 'thinkai' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .te-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ], 'separator' => 'before', ] ); $this->add_responsive_control( 'title_padding', [ 'label' => esc_html__( 'Padding', 'thinkai' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .te-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ], 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'title_bgtype', 'label' => __( 'Background', 'thinkai' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .te-title', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'title_border_type', 'selector' => '{{WRAPPER}} .te-title', 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'title_border_box_shadow', 'selector' => '{{WRAPPER}} .te-title', 'separator' => 'before', ] ); $this->add_control( 'title_border_radius', [ 'label' => esc_html__('Border Radius', 'thinkai'), 'type' => Controls_Manager::DIMENSIONS, 'separator' => 'before', 'size_units' => ['px'], 'selectors' => [ '{{WRAPPER}} .te-title' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ], ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Text Color', 'thinkai' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .te-title' => 'color: {{VALUE}} !important;', '{{WRAPPER}} .te-title a' => 'color: {{VALUE}} !important;', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'label' => __('Typography', 'thinkai'), 'selector' => '{{WRAPPER}} .te-title', ] ); $this->add_group_control( Group_Control_Text_Stroke::get_type(), [ 'name' => 'title_text_stroke', 'selector' => '{{WRAPPER}} .te-title', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'title_text_shadow', 'selector' => '{{WRAPPER}} .te-title', ] ); $this->end_controls_section(); //Text Style $this->start_controls_section( 'text_style', [ 'label' => esc_html__( 'Text Style Settings', 'thinkai' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'text__margin', [ 'label' => esc_html__( 'Margin', 'thinkai' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .te-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ], 'separator' => 'before', ] ); $this->add_responsive_control( 'text_padding', [ 'label' => esc_html__( 'Padding', 'thinkai' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .te-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ], 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'text_border_type', 'selector' => '{{WRAPPER}} .te-text', 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'text_border_box_shadow', 'selector' => '{{WRAPPER}} .te-text', 'separator' => 'before', ] ); $this->add_control( 'text_border_radius', [ 'label' => esc_html__('Border Radius', 'thinkai'), 'type' => Controls_Manager::DIMENSIONS, 'separator' => 'before', 'size_units' => ['px'], 'selectors' => [ '{{WRAPPER}} .te-text' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ], ] ); $this->add_control( 'text_color', [ 'label' => esc_html__( 'Text Color', 'thinkai' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .te-text' => 'color: {{VALUE}} !important;', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'text_typography', 'label' => __('Typography', 'thinkai'), 'selector' => '{{WRAPPER}} .te-text', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'text_text_shadow', 'selector' => '{{WRAPPER}} .te-text', ] ); $this->end_controls_section(); } /** * Render button widget output on the frontend. * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $allowed_tags = wp_kses_allowed_html('post'); $this->add_render_attribute( 'subtitle', 'class', 'te-subtitle' ); $subtitle = $settings['subtitle']; if( $settings[ 'subtitle_show' ] == 'yes' ){ $subtitle_html = sprintf( '<%1$s %2$s>%3$s%1$s>', Utils::validate_html_tag( $settings['small_title_tag'] ), $this->get_render_attribute_string( 'subtitle' ), $subtitle ); } $this->add_render_attribute( 'title', 'class', 'te-title title-animation' ); if ( ! empty( $settings['title_size'] ) ) { $this->add_render_attribute( 'title', 'class', 'thinkai-size-' . $settings['title_size'] ); } $title = $settings['title']; if( $settings[ 'title_show' ] == 'yes' ){ $title_html = sprintf( '<%1$s %2$s>%3$s%1$s>', Utils::validate_html_tag( $settings['title_tag'] ), $this->get_render_attribute_string( 'title' ), $title ); } $text = $settings[ 'text' ]; ?>