File: /storage/v6964/iskcon/public_html/wp-content/themes/tow-temple/tow-settings/pages/main/fields.php
<?php
function tow_register_main_options_metabox() {
$args = array(
'id' => PREFIX.'_main_options_page',
'title' => 'Tow Settings',
'menu_title' => 'Tow Settings',
'object_types' => array( 'options-page' ),
'option_key' => PREFIX.'_main_options',
'tab_group' => PREFIX.'_main_options',
'tab_title' => 'Welcome',
'position' => 2,
'capability' => 'manage_options',
);
// 'tab_group' property is supported in > 2.4.0.
if ( version_compare( CMB2_VERSION, '2.4.0' ) ) {
$args['display_cb'] = 'welcome_page';
}
$main_options = new_cmb2_box( $args );
/**
* Options fields ids only need
* to be unique within this box.
* Prefix is not needed.
*/
/*
$main_options->add_field( array(
'name' => 'Site Background Color',
'desc' => 'field description (optional)',
'id' => 'bg_color',
'type' => 'colorpicker',
'default' => '#ffffff',
) );
*/
}
add_action( 'cmb2_admin_init', 'tow_register_main_options_metabox' );
/**
* A CMB2 options-page display callback override which adds tab navigation among
* CMB2 options pages which share this same display callback.
*
* @param CMB2_Options_Hookup $cmb_options The CMB2_Options_Hookup object.
*/
function welcome_page( $cmb_options ) {
global $tabs;
$tabs = tow_options_page_tabs( $cmb_options );
do_action('my_custom_admin_enqueue_scripts');
include_once(get_template_directory() . '/tow-settings/template/header-top.php');
include_once(get_template_directory() . '/tow-settings/template/header.php');
?>
<section class="p_4 pb-0 cmb2-options-page option-<?php echo $cmb_options->option_key; ?>">
<div class="container-xl">
<div class="row">
<?php
include_once(get_template_directory() . '/tow-settings/template/left.php');
include_once(get_template_directory() . '/tow-settings/template/right-welcome.php');
?>
</div>
</div>
</section>
<?php
}