HEX
Server: Apache
System: Linux mykonsul-referensi-wordpress-859c8c8f8d-fq4qv 6.1.0-35-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.137-1 (2025-05-07) x86_64
User: (1001)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /opt/bitnami/wordpress/wp-content/plugins/bopea-function/block/layouts.php
<?php
namespace bopeaElementor\Widgets;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Image_Size;
use Elementor\Group_Control_Typography;
use Elementor\Schemes\Color;
use Elementor\Schemes\Typography;
use Elementor\Utils;
use Elementor\Control_Media;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Text_Shadow;
use Elementor\Group_Control_Background;
use Elementor\Repeater;
use Elementor\Icons_Manager;
defined('ABSPATH') || die();

class bopea_section_layouts extends Widget_Base {

    public function get_name() {
        return 'bopea-section-layouts';
    }

    public function get_title() {
        return esc_html__( 'Layouts', 'bopea-function' );
    }

    public function get_icon() {
        return 'eicon-layout-settings jl-icons';
    }

    public function get_categories() {
       return [ 'bopea-elements' ];
    }

    protected function register_controls() {

        $this->start_controls_section(
            'section_style_marker',
            [
                'label' => __( 'Layouts Settings', 'bopea-function' ),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );

        $this->add_control(
            'section_layouts',
            [
                'label'     =>esc_html__( 'Choose layouts', 'bopea-function' ),
                'type'      => Controls_Manager::SELECT,
                'options'     => bopea_get_all_posts(),                
            ]
        );

        $this->end_controls_section();        
    }
    protected function render( ) {
       $settings = $this->get_settings_for_display();
       $section_layouts = $settings['section_layouts'];
       if ( ! empty( $section_layouts ) ) {
        	echo do_shortcode( '[jl_layout id="' . esc_attr($section_layouts) . '"]' );
		}
    }
}