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

  /**
   * Create a custom meta boxes array that we pass to 
   * the OptionTree Meta Box API Class.
   */
  $speaker_meta_box = array(
    'id'          => 'xs_speaker_meta_box',
    'title'       => __( 'Speaker\'s Details', 'option-tree-theme' ),
    'desc'        => '',
    'pages'       => array( 'speaker' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => __( 'Speaker Name: (Optional, if it\'s left blank the default title will be used)', 'option-tree-theme' ),
        'id'          => 'xs_speaker_name',
        'type'        => 'text',
        'desc'        => '',
        'std'         => ''
      ),
      array(
	  'label'       => __( 'Speaker\'s job/profesion title', 'option-tree-theme' ),
        'id'          => 'xs_speaker_title',
        'type'        => 'text',
        'desc'        => '',
        'std'         => ''
      ),
      array(
        'label'       => __( 'Upload your speaker photo here (you can also use external links):', 'option-tree-theme' ),
        'id'          => 'xs_speaker_photo',
        '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( $speaker_meta_box );
	}

}