𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/builxejc/public_html/wp-content/plugins/kinsley-plugin/elementor/widgets//footer-menu.php
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Kinsley Footer Menu Widget.
*
* @since 1.0
*/
class Kinsley_Footer_Menu_Widget extends Widget_Base {
public function get_name() {
return 'kinsley-footer-menu';
}
public function get_title() {
return esc_html__( 'Footer Menu', '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(
'content_tab',
[
'label' => esc_html__( 'Content', '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(
'layout',
[
'label' => esc_html__( 'Select Layout', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 1,
'options' => [
1 => __( 'Vertical', 'kinsley-plugin' ),
],
]
);
$this->add_control(
'menu',
[
'label' => esc_html__( 'Select Menu', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => '',
'options' => $this->nav_menu_list(),
]
);
$this->add_responsive_control(
'align',
[
'label' => __( 'Alignment', 'kinsley-plugin' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'kinsley-plugin' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => __( 'Center', 'kinsley-plugin' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => __( 'Right', 'kinsley-plugin' ),
'icon' => 'eicon-text-align-right',
],
],
'selectors' => [
'{{WRAPPER}}' => 'text-align: {{VALUE}};',
],
'default' => 'left',
]
);
$this->end_controls_section();
$this->start_controls_section(
'content_styling',
[
'label' => esc_html__( 'Footer Menu Styling', '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}} h4' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'label' => esc_html__( 'Title Typography:', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} h4',
]
);
$this->add_control(
'menu_item_color',
[
'label' => esc_html__( 'Menu Item Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-footer-menu > li > a' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'menu_item_hover_color',
[
'label' => esc_html__( 'Menu Item Hover Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-footer-menu > li > a:hover' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'menu_item_typography',
'label' => esc_html__( 'Menu Item Typography:', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-footer-menu > li > a',
]
);
$this->end_controls_section();
}
/**
* Render Contact Form List.
*
* @since 1.0
*/
protected function nav_menu_list() {
$menus = wp_get_nav_menus();
$items = array();
$i = 0;
foreach ( $menus as $menu ) {
if ( $i == 0 ) {
$default = $menu->slug;
$i ++;
}
$items[ $menu->slug ] = $menu->name;
}
return $items;
}
/**
* Render widget output on the frontend.
*
* @since 1.0
*/
protected function render() {
$settings = $this->get_settings_for_display();
$this->add_inline_editing_attributes( 'title', 'basic' );
?>
<?php if ( $settings['title'] ) : ?>
<h4>
<span <?php echo $this->get_render_attribute_string( 'title' ); ?>>
<?php echo wp_kses_post( $settings['title'] ); ?>
</span>
</h4>
<?php endif; ?>
<?php kinsley_get_footermenu( $settings['menu'] ); ?>
<?php
}
}
Plugin::instance()->widgets_manager->register( new Kinsley_Footer_Menu_Widget() );