<?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/CMB2/CMB2
 */

/**
 * Get the bootstrap! If using the plugin from wordpress.org, REMOVE THIS!
 */

if ( file_exists( dirname( __FILE__ ) . '/CMB2-theme/init.php' ) ) {
	require_once dirname( __FILE__ ) . '/CMB2-theme/init.php';
} elseif ( file_exists( dirname( __FILE__ ) . '/CMB2-theme/init.php' ) ) {
	require_once dirname( __FILE__ ) . '/CMB2-theme/init.php';
}

function oryncart_page_meta_options() {
    $oryn_opt = new_cmb2_box( array(
        'id'            => 'oryncart_page_meta_options_fields',
        'title'         => esc_html__( 'Page Options', 'oryncart' ),
        'object_types'  => array( 'page' ),
    ) );
    $oryn_opt->add_field( array(
        'name'    => 'Hide Page Title',
        'desc'    => 'Select an option',
        'id'      => 'show_hide_pagetitle',
        'type'    => 'select',
        'default' => 'no',
        'options' => array(
            'yes' => __( 'Hide Title', 'oryncart' ),
            'no'  => __( 'Show Title', 'oryncart' ),
        ),
    ) );
}
add_action( 'cmb2_admin_init', 'oryncart_page_meta_options' );
