start_controls_section( 'section_title', [ 'label' => esc_html__( 'Heading', 'elementor' ), ] ); $this->add_control( 'title', [ 'label' => esc_html__( 'Title', 'elementor' ), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'ai' => [ 'type' => 'text', ], 'dynamic' => [ 'active' => true, ], 'placeholder' => esc_html__( 'Enter your title', 'elementor' ), 'default' => esc_html__( 'Add Your Heading Text Here', 'elementor' ), ] ); $this->add_control( 'link', [ 'label' => esc_html__( 'Link', 'elementor' ), 'type' => \Elementor\Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'default' => [ 'url' => '', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_title_style', [ 'label' => esc_html__( 'Heading', 'elementor' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Text Color', 'elementor' ), 'type' => \Elementor\Controls_Manager::COLOR, 'global' => [ 'default' => Global_Colors::COLOR_PRIMARY, ], 'selectors' => [ '{{WRAPPER}} .addon-btn-title' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'typography', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, ], 'selector' => '{{WRAPPER}} .addon-btn-title', ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); if ( '' === $settings['title'] ) { return; } $title = $settings['title']; if ( ! empty( $settings['link']['url'] ) ) { $this->add_link_attributes( 'url', $settings['link'] ); $title = sprintf( '%2$s
', $this->get_render_attribute_string( 'url' ), $title ); } else { $title = sprintf( '

%1$s

', $title ); } echo $title; } }