<?php

/**
 * Initialize the custom Meta Boxes. 
 */
add_action('admin_init', 'xs_single_meta_boxes');

/**
 * Meta Boxes demo code.
 *
 * You can find all the available option types in theme-options.php.
 *
 * @return    void
 * @since     2.3.0
 */
function xs_single_meta_boxes() {

    /**
     * Create a custom meta boxes array that we pass to 
     * the OptionTree Meta Box API Class.
     */
    $post_meta_box = array(
        'id' => 'xs_meta_box',
        'title' => __('Post Options', 'option-tree-theme'),
        'desc' => '',
        'pages' => array('post'),
        'context' => 'normal',
        'priority' => 'high',
        'fields' => array(
            array(
                'label' => __('General', 'option-tree-theme'),
                'id' => 'xs_post_general_title',
                'type' => 'tab'
            ),
            array(
                'label' => __('Show Comment', 'option-tree-theme'),
                'id' => 'xs_post_show_comment',
                'type' => 'on-off',
                'desc' => sprintf(__('Shows the "Comment Box" when set to %s.', 'option-tree-theme'), '<code>on</code>'),
                'std' => 'on'
            ),
            array(
                'label' => __('Show Author', 'option-tree-theme'),
                'id' => 'xs_post_show_author',
                'type' => 'on-off',
                'desc' => sprintf(__('Shows the "Author" when set to %s.', 'option-tree-theme'), '<code>on</code>'),
                'std' => 'on'
            ),
            array(
                'label' => __('Show Category', 'option-tree-theme'),
                'id' => 'xs_post_show_category',
                'type' => 'on-off',
                'desc' => sprintf(__('Shows the "Category" when set to %s.', 'option-tree-theme'), '<code>on</code>'),
                'std' => 'on'
            ),
            
//            array(
//                'label' => __('Sidebar', 'option-tree-theme'),
//                'id' => 'xs_post_sidebar',
//                'type' => 'sidebar-select',
//                'desc' => 'Please select sidebar. You can select no-sidebar to hide sidebar for this post.',
//                'std' => 'default-sidebar'
//            ),
            array(
                'label' => __('More Options', 'option-tree-theme'),
                'id' => 'xs_post_seo_options',
                'type' => 'tab'
            ),
            array(
                'label' => __('Keywords', 'option-tree-theme'),
                'id' => 'xs_post_seo_keywords',
                'type' => 'textarea',
                'desc' => __('Custom meta keywords for this spesific post', 'option-tree-theme')
            ),
            array(
                'label' => __('Description', 'option-tree-theme'),
                'id' => 'xs_post_seo_description',
                'type' => 'textarea',
                'desc' => __('Custom meta description for this spesific post', 'option-tree-theme')
            )
        )
    );


    /**
     * Register our meta boxes using the 
     * ot_register_meta_box() function.
     */
    if (function_exists('ot_register_meta_box')) {
        ot_register_meta_box($post_meta_box);
    }
}
