File: /home/retoti4c1e1s/www/thecommitment.earth/wp-content/themes/ananke/framework/meta-boxes.php
<?php
/**
* Registering meta boxes
*
* Using Meta Box plugin: http://www.deluxeblogtips.com/meta-box/
*
* @see https://docs.metabox.io/
*
* @param array $meta_boxes Default meta boxes. By default, there are no meta boxes.
*
* @return array All registered meta boxes
*/
function ananke_register_meta_boxes( $meta_boxes ) {
// Start with an underscore to hide fields from custom fields list
$prefix = '_cmb_';
$meta_boxes[] = array(
'id' => 'page_setting',
'title' => esc_html__( 'Page Setting', 'ananke' ),
'pages' => array('page'),
'context' => 'normal',
'priority' => 'high',
'autosave' => true,
'fields' => array(
array(
'name' => esc_html__( 'Page Sub Title', 'ananke' ),
'desc' => esc_html__( 'Set Page Sub Title', 'ananke' ),
'id' => $prefix . 'page_sub_title',
'type' => 'text',
),
array(
'name' => esc_html__( 'Upload header images', 'ananke' ),
'desc' => esc_html__( 'Upload header images', 'ananke' ),
'id' => $prefix . 'page_image',
'type' => 'image_advanced',
'max_file_uploads' => 1,
'image_size' => 'thumbnail',
),
)
);
// Add other metaboxes as needed
$meta_boxes[] = array(
'id' => 'testimonial_setting',
'title' => esc_html__( 'Testimonial Setting', 'ananke' ),
'pages' => array('testimonial'), // Post type
'context' => 'normal',
'priority' => 'high',
'autosave' => true,
'fields' => array(
array(
'name' => esc_html__( 'Company Name', 'ananke' ),
'desc' => esc_html__( 'Set company Name', 'ananke' ),
'id' => $prefix . 'company_name',
'type' => 'text',
),
)
);
// Add other metaboxes as needed
$meta_boxes[] = array(
'id' => 'post_setting',
'title' => esc_html__( 'Post Setting', 'ananke' ),
'pages' => array('post'),
'context' => 'normal',
'priority' => 'high',
'autosave' => true,
'fields' => array(
array(
'name' => esc_html__( 'Upload sub header images', 'ananke' ),
'desc' => esc_html__( 'Upload Page Header Background Image', 'ananke' ),
'id' => $prefix . 'blog_image',
'type' => 'image_advanced',
'max_file_uploads' => 1,
'image_size' => 'thumbnail',
'class' => 'gallery link image quote video audio standard',
),
array(
'name' => esc_html__( 'Gallery', 'ananke' ),
'id' => $prefix . 'images',
'type' => 'image_advanced',
'class' => 'gallery',
'image_size' => 'thumbnail',
),
array(
'name' => esc_html__( 'Link Audio', 'ananke' ),
'desc' => esc_html__( 'Add link Audio Soundcloud. Ex: https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/139083759', 'ananke' ),
'id' => $prefix . 'link_audio',
'type' => 'text',
'class' => 'audio',
),
array(
'name' => esc_html__( 'Link Video', 'ananke' ),
'desc' => esc_html__( 'Add link Video Youtube, Vimeo. Ex: http://www.youtube.com/embed/eP2VWNtU5rw or http://player.vimeo.com/video/20249835', 'ananke' ),
'id' => $prefix . 'link_video',
'type' => 'text',
'class' => 'video',
),
)
);
// Add other metaboxes as needed
$meta_boxes[] = array(
'id' => 'portfolio_setting',
'title' => esc_html__( 'Portfolio Setting','ananke' ),
'pages' => array('portfolio'),
'context' => 'normal',
'priority' => 'high',
'autosave' => true,
'fields' => array(
array(
'name' => esc_html__( 'Link Out Project','ananke' ),
'desc' => esc_html__( 'Link Example: http://themeforest.net/user/oceanthemes','ananke' ),
'id' => $prefix . 'link_project',
'type' => 'text',
),
array(
'name' => esc_html__( 'Link video','ananke' ),
'desc' => esc_html__( 'Link youtube Example: http://www.youtube.com/embed/hsEUBLIJvmE , Link Vimeo Ex : http://player.vimeo.com/video/23237102?portrait=0&color=cbab82 ','ananke' ),
'id' => $prefix . 'portfolio_video',
'type' => 'text',
),
array(
'name' => esc_html__( 'Link Audio', 'ananke' ),
'desc' => esc_html__( 'Add link Audio Soundcloud. Ex: https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/139083759', 'ananke' ),
'id' => $prefix . 'portfolio_audio',
'type' => 'text'
),
)
);
$meta_boxes[] = array(
'id' => 'slide_setting',
'title' => esc_html__( 'Slide Show Setting', 'ananke' ),
'pages' => array('slide'),
'context' => 'normal',
'priority' => 'high',
'autosave' => true,
'fields' => array(
array(
'name' => esc_html__( 'Tilt View', 'ananke' ),
'desc' => esc_html__( 'Column or Row', 'ananke' ),
'id' => $prefix . 'tilt_view',
'type' => 'select',
'options' => array(
'col' => esc_html__( 'Column', 'ananke' ),
'row' => esc_html__( 'Row', 'ananke' ),
),
'placeholder' => 'Select an Layout',
),
array(
'name' => esc_html__( 'Upload Image 1', 'ananke' ),
'desc' => esc_html__( 'Upload an image 1 for Project', 'ananke' ),
'id' => $prefix . 'image_1',
'type' => 'image_advanced',
'max_file_uploads' => 1,
'image_size' => 'thumbnail',
),
array(
'name' => esc_html__( 'Link Image 1', 'ananke' ),
'desc' => esc_html__( 'Link Example: http://themeforest.net/user/oceanthemes', 'ananke' ),
'id' => $prefix . 'link_1',
'type' => 'text',
),
array(
'name' => esc_html__( 'Upload Image 2', 'ananke' ),
'desc' => esc_html__( 'Upload an image 2 for Project', 'ananke' ),
'id' => $prefix . 'image_2',
'type' => 'image_advanced',
'max_file_uploads' => 1,
'image_size' => 'thumbnail',
),
array(
'name' => esc_html__( 'Link Image 2', 'ananke' ),
'desc' => esc_html__( 'Link Example: http://themeforest.net/user/oceanthemes', 'ananke' ),
'id' => $prefix . 'link_2',
'type' => 'text',
),
)
);
return $meta_boxes;
}
add_filter( 'rwmb_meta_boxes', 'ananke_register_meta_boxes' );