HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpprotonperinggit/wp-content/themes/voiture/inc/vendors/cmb2/page.php
<?php

if ( !function_exists( 'voiture_page_metaboxes' ) ) {
	function voiture_page_metaboxes(array $metaboxes) {
		global $wp_registered_sidebars;
        $sidebars = array();

        if ( !empty($wp_registered_sidebars) ) {
            foreach ($wp_registered_sidebars as $sidebar) {
                $sidebars[$sidebar['id']] = $sidebar['name'];
            }
        }
        $headers = array_merge( array('global' => esc_html__( 'Global Setting', 'voiture' )), voiture_get_header_layouts() );
        $footers = array_merge( array('global' => esc_html__( 'Global Setting', 'voiture' )), voiture_get_footer_layouts() );

		$prefix = 'apus_page_';

        $columns = array(
            '' => esc_html__( 'Global Setting', 'voiture' ),
            '1' => esc_html__('1 Column', 'voiture'),
            '2' => esc_html__('2 Columns', 'voiture'),
            '3' => esc_html__('3 Columns', 'voiture'),
            '4' => esc_html__('4 Columns', 'voiture'),
            '6' => esc_html__('6 Columns', 'voiture')
        );

        // Listings Page
        $fields = array(
            array(
                'name' => esc_html__( 'Listings Layout', 'voiture' ),
                'id'   => $prefix.'layout_type',
                'type' => 'select',
                'options' => array(
                    '' => esc_html__( 'Global Setting', 'voiture' ),
                    'default' => esc_html__('Default', 'voiture'),
                    'half-map' => esc_html__('Half Map', 'voiture'),
                    'top-map' => esc_html__('Top Map', 'voiture'),
                )
            ),
            array(
                'id' => $prefix.'display_mode',
                'type' => 'select',
                'name' => esc_html__('Default Display Mode', 'voiture'),
                'options' => array(
                    '' => esc_html__( 'Global Setting', 'voiture' ),
                    'grid' => esc_html__('Grid', 'voiture'),
                    'list' => esc_html__('List', 'voiture'),
                )
            ),
            array(
                'id' => $prefix.'inner_list_style',
                'type' => 'select',
                'name' => esc_html__('Listings list style', 'voiture'),
                'options' => array(
                    '' => esc_html__( 'Global Setting', 'voiture' ),
                    'list' => esc_html__('List Default', 'voiture'),
                    'list-v1' => esc_html__('List V1', 'voiture'),
                ),
            ),
            array(
                'id' => $prefix.'inner_grid_style',
                'type' => 'select',
                'name' => esc_html__('Listings grid style', 'voiture'),
                'options' => array(
                    '' => esc_html__( 'Global Setting', 'voiture' ),
                    'grid' => esc_html__('Grid Default', 'voiture'),
                    'grid-v1' => esc_html__('Grid V1', 'voiture'),
                    'grid-v2' => esc_html__('Grid V2', 'voiture'),
                    'grid-v3' => esc_html__('Grid V3', 'voiture'),
                ),
            ),
            array(
                'id' => $prefix.'listings_columns',
                'type' => 'select',
                'name' => esc_html__('Grid Listing Columns', 'voiture'),
                'options' => $columns,
            ),
            array(
                'id' => $prefix.'listings_list_columns',
                'type' => 'select',
                'name' => esc_html__('List Listing Columns', 'voiture'),
                'options' => $columns,
            ),
            array(
                'id' => $prefix.'listings_pagination',
                'type' => 'select',
                'name' => esc_html__('Pagination Type', 'voiture'),
                'options' => array(
                    '' => esc_html__( 'Global Setting', 'voiture' ),
                    'default' => esc_html__('Default', 'voiture'),
                    'loadmore' => esc_html__('Load More Button', 'voiture'),
                    'infinite' => esc_html__('Infinite Scrolling', 'voiture'),
                ),
            ),

            array(
                'id' => $prefix.'listings_show_filter_top',
                'type' => 'select',
                'name' => esc_html__('Show Filter Top', 'voiture'),
                'options' => array(
                    '' => esc_html__( 'Global Setting', 'voiture' ),
                    'no' => esc_html__('No', 'voiture'),
                    'yes' => esc_html__('Yes', 'voiture')
                ),
            ),
            array(
                'id' => $prefix.'listings_filter_top_sidebar',
                'type' => 'select',
                'name' => esc_html__('Listings Filter Top Sidebar', 'voiture'),
                'description' => esc_html__('Choose a filter top sidebar for your website.', 'voiture'),
                'options' => array(
                    '' => esc_html__('Global Setting', 'voiture'),
                    'listings-filter-top' => esc_html__('Listings Filter Top Sidebar', 'voiture'),
                    'listings-filter-top2' => esc_html__('Listings Filter Top 2 Sidebar', 'voiture'),
                ),
                'default' => ''
            ),

            array(
                'id' => $prefix.'listings_filter_sidebar',
                'type' => 'select',
                'name' => esc_html__('Listings Filter Sidebar', 'voiture'),
                'description' => esc_html__('Choose a filter sidebar for your website.', 'voiture'),
                'options' => array(
                    '' => esc_html__('Global Setting', 'voiture'),
                    'listings-filter' => esc_html__('Listings Filter Sidebar', 'voiture'),
                    'listings-filter2' => esc_html__('Listings Filter 2 Sidebar', 'voiture'),
                ),
                'default' => ''
            ),
        );
        
        $metaboxes[$prefix . 'listings_setting'] = array(
            'id'                        => $prefix . 'listings_setting',
            'title'                     => esc_html__( 'Listings Settings', 'voiture' ),
            'object_types'              => array( 'page' ),
            'context'                   => 'normal',
            'priority'                  => 'high',
            'show_names'                => true,
            'fields'                    => $fields
        );

        // General
	    $fields = array(
			array(
				'name' => esc_html__( 'Select Layout', 'voiture' ),
				'id'   => $prefix.'layout',
				'type' => 'select',
				'options' => array(
					'main' => esc_html__('Main Content Only', 'voiture'),
					'left-main' => esc_html__('Left Sidebar - Main Content', 'voiture'),
					'main-right' => esc_html__('Main Content - Right Sidebar', 'voiture')
				)
			),
			array(
                'id' => $prefix.'fullwidth',
                'type' => 'select',
                'name' => esc_html__('Is Full Width?', 'voiture'),
                'default' => 'no',
                'options' => array(
                    'no' => esc_html__('No', 'voiture'),
                    'yes' => esc_html__('Yes', 'voiture')
                )
            ),
            array(
                'id' => $prefix.'left_sidebar',
                'type' => 'select',
                'name' => esc_html__('Left Sidebar', 'voiture'),
                'options' => $sidebars
            ),
            array(
                'id' => $prefix.'right_sidebar',
                'type' => 'select',
                'name' => esc_html__('Right Sidebar', 'voiture'),
                'options' => $sidebars
            ),
            array(
                'id' => $prefix.'show_breadcrumb',
                'type' => 'select',
                'name' => esc_html__('Show Breadcrumb?', 'voiture'),
                'options' => array(
                    'no' => esc_html__('No', 'voiture'),
                    'yes' => esc_html__('Yes', 'voiture')
                ),
                'default' => 'yes',
            ),
            array(
                'id' => $prefix.'breadcrumb_color',
                'type' => 'colorpicker',
                'name' => esc_html__('Breadcrumb Background Color', 'voiture')
            ),
            array(
                'id' => $prefix.'breadcrumb_image',
                'type' => 'file',
                'name' => esc_html__('Breadcrumb Background Image', 'voiture')
            ),

            array(
                'id' => $prefix.'header_type',
                'type' => 'select',
                'name' => esc_html__('Header Layout Type', 'voiture'),
                'description' => esc_html__('Choose a header for your website.', 'voiture'),
                'options' => $headers,
                'default' => 'global'
            ),
            array(
                'id' => $prefix.'header_transparent',
                'type' => 'select',
                'name' => esc_html__('Header Transparent', 'voiture'),
                'description' => esc_html__('Choose a header for your website.', 'voiture'),
                'options' => array(
                    'no' => esc_html__('No', 'voiture'),
                    'yes' => esc_html__('Yes', 'voiture')
                ),
                'default' => 'global'
            ),
            array(
                'id' => $prefix.'header_fixed',
                'type' => 'select',
                'name' => esc_html__('Header Fixed Top', 'voiture'),
                'description' => esc_html__('Choose a header position', 'voiture'),
                'options' => array(
                    'no' => esc_html__('No', 'voiture'),
                    'yes' => esc_html__('Yes', 'voiture')
                ),
                'default' => 'no'
            ),
            array(
                'id' => $prefix.'footer_type',
                'type' => 'select',
                'name' => esc_html__('Footer Layout Type', 'voiture'),
                'description' => esc_html__('Choose a footer for your website.', 'voiture'),
                'options' => $footers,
                'default' => 'global'
            ),
            array(
                'id' => $prefix.'extra_class',
                'type' => 'text',
                'name' => esc_html__('Extra Class', 'voiture'),
                'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'voiture')
            )
    	);
		
	    $metaboxes[$prefix . 'display_setting'] = array(
			'id'                        => $prefix . 'display_setting',
			'title'                     => esc_html__( 'Display Settings', 'voiture' ),
			'object_types'              => array( 'page' ),
			'context'                   => 'normal',
			'priority'                  => 'high',
			'show_names'                => true,
			'fields'                    => $fields
		);

	    return $metaboxes;
	}
}
add_filter( 'cmb2_meta_boxes', 'voiture_page_metaboxes' );

if ( !function_exists( 'voiture_cmb2_style' ) ) {
	function voiture_cmb2_style() {
        wp_enqueue_style( 'voiture-cmb2-style', get_template_directory_uri() . '/inc/vendors/cmb2/assets/style.css', array(), '1.0' );
		wp_enqueue_script( 'voiture-admin', get_template_directory_uri() . '/js/admin.js', array( 'jquery' ), '20150330', true );
	}
}
add_action( 'admin_enqueue_scripts', 'voiture_cmb2_style' );