Widget_Sidebar::_register_controls()
Register sidebar widget controls.
Description
Adds different input fields to allow the user to change and customize the widget settings.
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |
Source
includes/widgets/sidebar.php
$default_key = array_shift( $default_key ); $this->start_controls_section( 'section_sidebar', [ 'label' => __( 'Sidebar', 'elementor' ), ] ); $this->add_control( 'sidebar', [ 'label' => __( 'Choose Sidebar', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => $default_key, 'options' => $options, ] ); $this->end_controls_section(); } /** * Render sidebar widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $sidebar = $this->get_settings_for_display( 'sidebar' ); if ( empty( $sidebar ) ) { return; }