𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/builxejc/public_html/wp-content/plugins/kinsley-plugin/elementor/widgets//section-heading.php
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Kinsley Section Heading Widget.
*
* @since 1.0
*/
class Kinsley_Section_Heading_Widget extends Widget_Base {
public function get_name() {
return 'kinsley-section-heading';
}
public function get_title() {
return esc_html__( 'Section Heading', 'kinsley-plugin' );
}
public function get_icon() {
return 'eicon-parallax';
}
public function get_categories() {
return [ 'kinsley-category' ];
}
/**
* Register widget controls.
*
* @since 1.0
*/
protected function register_controls() {
$this->start_controls_section(
'title_tab',
[
'label' => esc_html__( 'Title', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'title',
[
'label' => esc_html__( 'Title', 'kinsley-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Enter title', 'kinsley-plugin' ),
'default' => esc_html__( 'Title', 'kinsley-plugin' ),
]
);
$this->add_control(
'title_tag',
[
'label' => esc_html__( 'Title Tag', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'h2',
'options' => [
'h1' => __( 'H1', 'kinsley-plugin' ),
'h2' => __( 'H2', 'kinsley-plugin' ),
'h3' => __( 'H3', 'kinsley-plugin' ),
'h4' => __( 'H4', 'kinsley-plugin' ),
'div' => __( 'DIV', 'kinsley-plugin' ),
],
]
);
$this->add_control(
'description',
[
'label' => esc_html__( 'Description', 'kinsley-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Enter description', 'kinsley-plugin' ),
'default' => esc_html__( 'Description', 'kinsley-plugin' ),
]
);
$this->add_control(
'more',
[
'label' => esc_html__( 'Button (label)', 'kinsley-plugin' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'placeholder' => esc_html__( 'Button', 'kinsley-plugin' ),
]
);
$this->add_control(
'link',
[
'label' => esc_html__( 'Button (link)', 'kinsley-plugin' ),
'type' => Controls_Manager::URL,
'show_external' => true,
]
);
$this->end_controls_section();
$this->start_controls_section(
'title_styling',
[
'label' => esc_html__( 'Title', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Title Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-title-frame .knsl-title--h' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'label' => esc_html__( 'Title Typography', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-title-frame .knsl-title--h',
]
);
$this->add_control(
'description_color',
[
'label' => esc_html__( 'Description Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-title-frame .knsl-text' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'description_typography',
'label' => esc_html__( 'Description Typography', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-title-frame .knsl-text',
]
);
$this->add_control(
'button_color',
[
'label' => esc_html__( 'Button Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-title-frame .knsl-btn' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'button_bgcolor',
[
'label' => esc_html__( 'Button BG Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-title-frame .knsl-btn' => 'background-color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'button_typography',
'label' => esc_html__( 'Button Typography', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-title-frame .knsl-btn',
]
);
$this->end_controls_section();
}
/**
* Render widget output on the frontend.
*
* @since 1.0
*/
protected function render() {
$settings = $this->get_settings_for_display();
$this->add_inline_editing_attributes( 'more', 'none' );
$this->add_inline_editing_attributes( 'title', 'basic' );
$this->add_inline_editing_attributes( 'description', 'basic' );
?>
<!-- section heading -->
<section class="knsl-p-0-90">
<div class="container">
<div class="row">
<?php if ( $settings['title'] || $settings['more'] || $settings['description'] ) : ?>
<div class="col-lg-12">
<div class="knsl-center knsl-title-frame knsl-mb-100">
<?php if ( $settings['title'] ) : ?>
<<?php echo esc_attr( $settings['title_tag'] ); ?> class="knsl-title--h knsl-mb-20">
<span <?php echo $this->get_render_attribute_string( 'title' ); ?>>
<?php echo wp_kses_post( $settings['title'] ); ?>
</span>
</<?php echo esc_attr( $settings['title_tag'] ); ?>>
<?php endif; ?>
<?php if ( $settings['description'] ) : ?>
<div class="knsl-text knsl-mb-30">
<p>
<span <?php echo $this->get_render_attribute_string( 'description' ); ?>>
<?php echo wp_kses_post( $settings['description'] ); ?>
</span>
</p>
</div>
<?php endif; ?>
<?php if ( $settings['more'] ) : ?>
<a<?php if ( $settings['link'] ) : if ( $settings['link']['is_external'] ) : ?> target="_blank"<?php endif; ?><?php if ( $settings['link']['nofollow'] ) : ?> rel="nofollow"<?php endif; ?> href="<?php echo esc_url( $settings['link']['url'] ); ?>"<?php endif; ?> class="knsl-btn knsl-btn-md">
<span <?php echo $this->get_render_attribute_string( 'more' ); ?>>
<?php echo wp_kses_post( $settings['more'] ); ?>
</span>
</a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</section>
<!-- section heading end -->
<?php
}
/**
* Render widget output in the editor.
*
* Written as a Backbone JavaScript template and used to generate the live preview.
*
* @since 1.0.0
* @access protected
*/
protected function content_template() {
?>
<#
view.addInlineEditingAttributes( 'more', 'none' );
view.addInlineEditingAttributes( 'title', 'basic' );
view.addInlineEditingAttributes( 'description', 'basic' );
#>
<!-- section heading -->
<section class="knsl-p-0-90">
<div class="container">
<div class="row">
<# if ( settings.title || settings.more || settings.description ) { #>
<div class="col-lg-12">
<div class="knsl-center knsl-title-frame knsl-mb-100">
<# if ( settings.title ) { #>
<{{{ settings.title_tag }}} class="knsl-title--h knsl-mb-20">
<span {{{ view.getRenderAttributeString( 'title' ) }}}>
{{{ settings.title }}}
</span>
</{{{ settings.title_tag }}}>
<# } #>
<# if ( settings.description ) { #>
<div class="knsl-text knsl-mb-30">
<p>
<span {{{ view.getRenderAttributeString( 'description' ) }}}>
{{{ settings.description }}}
</span>
</p>
</div>
<# } #>
<# if ( settings.more ) { #>
<a<# if ( settings.link ) { if ( settings.link.is_external ) { #> target="_blank"<# } #><# if ( settings.link.nofollow ) { #> rel="nofollow"<# } #> href="{{{ settings.link.url }}}"<# } #> class="knsl-btn knsl-btn-md">
<span {{{ view.getRenderAttributeString( 'more' ) }}}>
{{{ settings.more }}}
</span>
</a>
<# } #>
</div>
</div>
<# } #>
</div>
</div>
</section>
<!-- section heading -->
<?php
}
}
Plugin::instance()->widgets_manager->register( new Kinsley_Section_Heading_Widget() );