<?php
$data = solarva_get_sidebar();
$default = isset($data['default']) ? (string)$data['default'] : '';
$options = isset($data['options']) ? $data['options'] : ['' => 'Sidebar Not Found'];
pxl_add_custom_widget(
    array(
        'name' => 'pxl_sidebar',
        'title' => esc_html__('Case Sidebar', 'solarva' ),
        'icon' => 'eicon-accordion',
        'categories' => array('pxltheme-core'),
        'params' => array(
            'sections' => array(
                array(
                    'name' => 'section_content',
                    'label' => esc_html__('Content', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
                    'controls' => array(
                        array(
                            'name' => 'sidebar',
                            'label' => esc_html__('Sidebar', 'solarva'),
                            'type' => Elementor\Controls_Manager::SELECT,
                            'default' => $default,
                            'options' => $options,
                        ),
                    ),
                ),
            ),
        ),
    ),
    solarva_get_class_widget_path()
);