Current File : /home/kelaby89/sergio-cuchi.tattoo/wp-content/themes/maori/includes/meta-boxes.php |
<?php
/* ---------------------------------------------------------
Page Title
----------------------------------------------------------- */
function maori_page_title_cmb2 ( $meta_boxes ) {
$prefix = 'maori_cmb2'; // Prefix for all fields
$meta_boxes['maori_pagetitle'] = array(
'id' => 'maori_pagetitle',
'title' => esc_html__( 'Show Title', 'maori'),
'object_types' => array('page','maoriartists'), // post type
'context' => 'side', // normal or side
'priority' => 'high', // default or high
'show_names' => false, // Show field names on the left
'fields' => array(
array(
'name' => esc_html__( 'Show title', 'maori'),
'desc' => '',
'id' => $prefix . '_pagetitle',
'type' => 'radio_inline',
'options' => array(
'yes' => esc_html__( 'Yes', 'maori' ),
'no' => esc_html__( 'No', 'maori' ),
),
'default' => 'yes'
)
),
);
return $meta_boxes;
}
add_filter( 'cmb2_meta_boxes', 'maori_page_title_cmb2' );
/* ---------------------------------------------------------
Subtitle
----------------------------------------------------------- */
function maori_subtitle_cmb2 ( $meta_boxes ) {
$prefix = 'maori_cmb2'; // Prefix for all fields
$meta_boxes['maori_subtitle'] = array(
'id' => 'maori_subtitle',
'title' => esc_html__( 'Subtitle', 'maori'),
'object_types' => array('page','maoriartists'), // post type
'context' => 'normal', // normal or side
'priority' => 'high', // default or high
'show_names' => false, // Show field names on the left
'fields' => array(
array(
'name' => esc_html__( 'Subtitle (Optional)', 'maori'),
'desc' => '',
'id' => $prefix . '_subtitle',
'type' => 'text'
)
),
);
return $meta_boxes;
}
add_filter( 'cmb2_meta_boxes', 'maori_subtitle_cmb2' );
/* ---------------------------------------------------------
Background
----------------------------------------------------------- */
function maori_background_cmb2 ( $meta_boxes ) {
$prefix = 'maori_cmb2'; // Prefix for all fields
$meta_boxes['maori_background'] = array(
'id' => 'maori_background',
'title' => esc_html__( 'Background', 'maori'),
'object_types' => array('page','post','maoriartists'), // post type
'context' => 'side', // normal or side
'priority' => 'high', // default or high
'show_names' => false, // Show field names on the left
'fields' => array(
array(
'name' => esc_html__( 'Background', 'maori'),
'desc' => '',
'id' => $prefix . '_background',
'type' => 'radio_inline',
'options' => array(
'yes' => esc_html__( 'Black', 'maori' ),
'no' => esc_html__( 'Transparent', 'maori' ),
),
'default' => 'yes'
)
),
);
return $meta_boxes;
}
add_filter( 'cmb2_meta_boxes', 'maori_background_cmb2' );
?>