| Server IP : 38.190.208.107 / Your IP : 216.73.217.51 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.9/wp-content/themes/woodmart/inc/integrations/elementor/elements/ |
Upload File : |
<?php
/**
* Sidebar element.
*
* @package woodmart
*/
namespace XTS\Modules\Layouts;
use Elementor\Controls_Manager;
use Elementor\Plugin;
use Elementor\Widget_Base;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Direct access not allowed.
}
/**
* Elementor widget that inserts an embeddable content into the page, from any given URL.
*/
class Sidebar extends Widget_Base {
/**
* Get widget name.
*
* @return string Widget name.
*/
public function get_name() {
return 'wd_sidebar';
}
/**
* Get widget content.
*
* @return string Widget title.
*/
public function get_title() {
return esc_html__( 'Sidebar', 'woodmart' );
}
/**
* Get widget icon.
*
* @return string Widget icon.
*/
public function get_icon() {
return 'wd-icon-sa-sidebar';
}
/**
* Get widget keywords.
*
* Retrieve the list of keywords the widget belongs to.
*
* @since 2.1.0
* @access public
*
* @return array Widget keywords.
*/
public function get_keywords() {
return array( 'off', 'canvas', 'sidebar' );
}
/**
* Get widget categories.
*
* @return array Widget categories.
*/
public function get_categories() {
return [ 'wd-elements' ];
}
/**
* Register the widget controls.
*/
protected function register_controls() {
global $wp_registered_sidebars;
$options = array();
if ( ! $wp_registered_sidebars ) {
$options[''] = esc_html__( 'No sidebars were found', 'woodmart' );
} else {
$options[''] = esc_html__( 'Choose Sidebar', 'woodmart' );
foreach ( $wp_registered_sidebars as $sidebar_id => $sidebar ) {
$options[ $sidebar_id ] = $sidebar['name'];
}
}
$default_key = array_keys( $options );
$default_key = array_shift( $default_key );
/**
* Content tab
*/
/**
* General settings
*/
$this->start_controls_section(
'general_content_section',
array(
'label' => esc_html__( 'General', 'woodmart' ),
'tab' => Controls_Manager::TAB_CONTENT,
)
);
$this->add_control(
'sidebar_name',
array(
'label' => esc_html__( 'Choose Sidebar', 'elementor' ),
'type' => Controls_Manager::SELECT,
'default' => $default_key,
'options' => $options,
)
);
$this->end_controls_section();
}
/**
* Render the widget output on the frontend.
*/
protected function render() {
$settings = wp_parse_args(
$this->get_settings_for_display(),
array(
'sidebar_name' => '',
)
);
dynamic_sidebar( $settings['sidebar_name'] );
}
}
Plugin::instance()->widgets_manager->register( new Sidebar() );