# gallery-box/trunk/includes/elementor-addon.php

Gallery Box, version trunk. 165 lines.

- Page: https://pluginprobe.com/plugins/gallery-box/trunk/code/includes/elementor-addon.php
- Raw: https://pluginprobe.com/plugins/gallery-box/trunk/raw/includes/elementor-addon.php
- Modified: 2026-04-07T03:48:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/gallery-box/trunk/code/includes/elementor-addon.php#L10-L20`.

```php
<?php
/*
*
* Elementor Addons
*
*/
class gBoxEWidget extends \Elementor\Widget_Base
{

    /**
     * Get widget name.
     *
     * Retrieve Blank widget name.
     *
     * @return string Widget name.
     * @since 1.0.0
     * @access public
     *
     */
    public function get_name()
    {
        return 'gbox_shortcode';
    }

    /**
     * Get widget title.
     *
     * Retrieve Blank widget title.
     *
     * @return string Widget title.
     * @since 1.0.0
     * @access public
     *
     */
    public function get_title()
    {
        return __('Gallery Box', 'gallery-box');
    }

    /**
     * Get widget icon.
     *
     * Retrieve Blank widget icon.
     *
     * @return string Widget icon.
     * @since 1.0.0
     * @access public
     *
     */
    public function get_icon()
    {
        return 'eicon-gallery-grid';
    }

    /**
     * Get widget categories.
     *
     * Retrieve the list of categories the Blank widget belongs to.
     *
     * @return array Widget categories.
     * @since 1.0.0
     * @access public
     *
     */
    public function get_categories()
    {
        return ['general'];
    }
    /**
     * 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 ['shortcode', 'gallery', 'image', 'video', 'lightbox'];
    }

    /**
     * Whether the reload preview is required or not.
     *
     * Used to determine whether the reload preview is required.
     *
     * @since 1.0.0
     * @access public
     *
     * @return bool Whether the reload preview is required.
     */
    public function is_reload_preview_required()
    {
        return true;
    }
    /**
     * Register Blank widget controls.
     *
     * Adds different input fields to allow the user to change and customize the widget settings.
     *
     * @since 1.0.0
     * @access protected
     */
    protected function register_controls()
    {
        $this->register_content_controls();
    }

    /**
     * Register Blank widget content ontrols.
     *
     * Adds different input fields to allow the user to change and customize the widget settings.
     *
     * @since 1.0.0
     * @access protected
     */
    function register_content_controls()
    {

        $this->start_controls_section(
            'mgpl_query',
            [
                'label' => esc_html__('Gallery Box', 'gallery-box'),
            ]
        );


        $this->add_control(
            'gbox_id',
            [
                'label' => __('Select Gallery Box Gallery', 'gallery-box'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'label_block' => true,
                'multiple' => false,
                'default' => '0',
                'options' => gbox_gallery_list(),

            ]
        );

        $this->end_controls_section();
    }



    /**
     * Render Blank widget output on the frontend.
     *
     * Written in PHP and used to generate the final HTML.
     *
     * @since 1.0.0
     * @access protected
     */
    protected function render()
    {

        $settings = $this->get_settings_for_display();
        $gbox_id = isset($settings['gbox_id']) ? intval($settings['gbox_id']) : 0;

        echo do_shortcode('[gallerybox id="' . $gbox_id . '"]');
    }
}

```
