<?php
/**
 * Initialize the custom Meta Boxes. 
 */
add_action( 'admin_init', 'xs_slider_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_slider_meta_boxes() {

  /**
   * Create a custom meta boxes array that we pass to 
   * the OptionTree Meta Box API Class.
   */
  $slider_meta_box = array(
    'id'          => 'xs_slider_meta_box',
    'title'       => __( 'Slider Image', 'option-tree-theme' ),
    'desc'        => '',
    'pages'       => array( 'xs_slider' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => __( 'Upload your image here (you can also use external links):', 'option-tree-theme' ),
        'id'          => 'xs_slider_image',
        'type'        => 'upload',
        'desc'        => '',
        'std'         => ''
      )
    )
  );
  
  /**
   * Register our meta boxes using the 
   * ot_register_meta_box() function.
   */
	if ( function_exists( 'ot_register_meta_box' ) ){
		ot_register_meta_box( $slider_meta_box );
	}

}