HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1014-azure #14~24.04.1-Ubuntu SMP Fri Oct 3 20:52:11 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /mnt/data/dreamsrent-wp-demo/wp-content/themes/dreamsrent/inc/metabox.php
<?php
/**
 * Include and setup custom metaboxes and fields. (make sure you copy this file to outside the CMB2 directory)
 *
 * Be sure to replace all instances of 'yourprefix_' with your project's prefix.
 * http://nacin.com/2010/05/11/in-wordpress-prefix-everything/
 *
 * @category YourThemeOrPlugin
 * @package  Demo_CMB2
 * @license  http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
 * @link     https://github.com/WebDevStudios/CMB2
 */



add_action( 'cmb2_init', 'dreamsrent_metaboxes_default' );
function dreamsrent_metaboxes_default() {

    // Start with an underscore to hide fields from custom fields list
    $prefix = 'dreamsrent_met_';

    

    
    /* Page Settings ***************************************************************************/
    /* ************************************************************************************/
    $page_settings = new_cmb2_box( array(
        'id'            => 'page_heading_settings',
        'title'         => esc_html__( 'Show Page Heading','dreamsrent' ),
        'object_types'  => array( 'page', 'post'), // Post type
        'context'       => 'normal',
        'priority'      => 'high',
        'show_names'    => true,
        
    ) );

        // Display title of page
        $page_settings->add_field( array(
            'name'       => esc_html__( 'Show title of page','dreamsrent' ),
            'desc'       => esc_html__( 'Allow display title of page','dreamsrent' ),
            'id'         => $prefix . 'page_heading',
            'type'             => 'select',
            'show_option_none' => false,
            'options'          => array(
                'yes' => esc_html__( 'Yes','dreamsrent' ),
                'no'   => esc_html__('No','dreamsrent' )
            ),
            'default' => 'yes',
            
        ) );

        $page_settings->add_field( array(
            'name'       => esc_html__( 'Show Breadcrumbs','dreamsrent' ),
            'id'         => $prefix . 'show_breadcrumbs',
            'type'             => 'select',
            'show_option_none' => false,
            'options'          => array(
                'yes' => esc_html__( 'Yes' ,'dreamsrent'),
                'no'   => esc_html__('No','dreamsrent' )
            ),
            'default' => 'yes',
            
        ) );

        


    
   

    
    /* Post Settings *********************************************************************************/
    /* *******************************************************************************/
    $post_settings = new_cmb2_box( array(
        'id'            => 'post_video',
        'title'         => esc_html__( 'Post Settings','dreamsrent' ),
        'object_types'  => array( 'post'), // Post type
        'context'       => 'normal',
        'priority'      => 'high',
        'show_names'    => true, // Show field names on the left
    ) );

        // Video or Audio
        $post_settings->add_field( array(
            'name'       => esc_html__( 'Link audio or video','dreamsrent' ),
            'desc'       => esc_html__( 'Insert link audio or video use for video/audio post-format','dreamsrent' ),
            'id'         => $prefix . 'embed_media',
            'type'             => 'oembed',
        ) );


        // Gallery image
        $post_settings->add_field( array(
            'name'       => esc_html__( 'Gallery image','dreamsrent' ),
            'desc'       => esc_html__( 'image in gallery post format' ,'dreamsrent'),
            'id'         => $prefix . 'file_list',
            'type'             => 'file_list',
        ) );

 
        /* Vehicle Settings ***************************************************************************/
        /* ************************************************************************************/
        $vehicle_settings = new_cmb2_box( array(
            'id'            => 'vehicle_settings',
            'title'         => esc_html__( 'Vehicle Settings','dreamsrent' ),
            'object_types'  => array( 'vehicle'), // Post type
            'context'       => 'normal',
            'priority'      => 'high',
            'show_names'    => true,
            
        ) );


           

            // Display title of page
            $vehicle_settings->add_field( array(
                'name'       => esc_html__( 'ID Vehicle','dreamsrent' ),
                'description'       => esc_html__( 'It is Unique, No Special Character, Space','dreamsrent' ),
                'id'         => $prefix . 'id_vehicle',
                'type'             => 'text',
                'show_option_none' => false,
                
            ) );

           
            

            $vehicle_settings->add_field( array(
                'name'       => esc_html__( 'ID Vehicle is in the location','dreamsrent' ),
                'id'         => $prefix.'id_vehicle_location',
                'type'             => 'select',
                'show_option_none' => false,
                'options'          => $id_vehicle_location,
                'default' => '',
                
            ) );

            // $vehicle_settings->add_field( array(
            //     'name' => esc_html__( 'Address','dreamsrent' ),
            //     'desc' => esc_html__( 'Drag the marker to set the exact location','dreamsrent' ),
            //     'id' => $prefix . 'vehicle_address',
            //     'type' => 'pw_map',
            //     'split_values' => true, // Save latitude and longitude as two separate fields
            // ) );

            
            //  $vehicle_settings->add_field( array(
            //     'name'       => esc_html__( 'Unavailable Time' ,'dreamsrent'),
            //     'id'         => $prefix.'id_vehicle_untime_from_day',
            //     'type'             => 'dsr_range_time',
            //     'default' => '',
                
            // ) );
            
            
   
}