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 . '"]'); } }