start_controls_section( 'section_content', [ 'label' => __( 'Site Tagline', 'admore-widgets-suite' ), ] ); $this->add_control( 'custom_tagline', [ 'label' => __( 'Custom Text', 'admore-widgets-suite' ), 'type' => Controls_Manager::TEXT, 'placeholder' => get_bloginfo( 'description' ), 'description' => __( 'Leave empty to use the site tagline from Settings → General.', 'admore-widgets-suite' ), ] ); $this->add_control( 'tag', [ 'label' => __( 'HTML Tag', 'admore-widgets-suite' ), 'type' => Controls_Manager::SELECT, 'default' => 'p', 'options' => [ 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'p' => 'P', 'span' => 'SPAN' ], ] ); $this->add_control( 'alignment', [ 'label' => __( 'Alignment', 'admore-widgets-suite' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'admore-widgets-suite' ), 'icon' => 'eicon-text-align-left' ], 'center' => [ 'title' => __( 'Center', 'admore-widgets-suite' ), 'icon' => 'eicon-text-align-center' ], 'right' => [ 'title' => __( 'Right', 'admore-widgets-suite' ), 'icon' => 'eicon-text-align-right' ], ], 'default' => 'center', 'selectors' => [ '{{WRAPPER}} .eppro-site-tagline' => 'text-align: {{VALUE}};' ], ] ); $this->end_controls_section(); $this->start_controls_section( 'style_tagline', [ 'label' => __( 'Tagline', 'admore-widgets-suite' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'tagline_typography', 'selector' => '{{WRAPPER}} .eppro-site-tagline', ] ); $this->add_control( 'tagline_color', [ 'label' => __( 'Color', 'admore-widgets-suite' ), 'type' => Controls_Manager::COLOR, 'default' => '#64748b', 'selectors' => [ '{{WRAPPER}} .eppro-site-tagline' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'tagline_shadow', 'selector' => '{{WRAPPER}} .eppro-site-tagline', ] ); $this->end_controls_section(); } protected function render(): void { $s = $this->get_settings_for_display(); $tag = esc_attr( $s['tag'] ); $text = ! empty( $s['custom_tagline'] ) ? esc_html( $s['custom_tagline'] ) : esc_html( get_bloginfo( 'description' ) ); if ( '' === $text && ! \Elementor\Plugin::$instance->editor->is_edit_mode() ) return; if ( '' === $text ) $text = esc_html__( '(Site tagline not set)', 'admore-widgets-suite' ); echo wp_kses_post( '<' . $tag . ' class="eppro-site-tagline">' . $text . '' ); } }