<?php
/**
 * Registering meta boxes
 *
 * All the definitions of meta boxes are listed below with comments.
 * Please read them CAREFULLY.
 *
 * You also should read the changelog to know what has been changed before updating.
 *
 * For more information, please visit:
 * @link http://metabox.io/docs/registering-meta-boxes/
 */
 
add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
/**
 * Register meta boxes
 *
 * Remember to change "your_prefix" to actual prefix in your project
 *
 * @param array $meta_boxes List of meta boxes
 *
 * @return array
 */
function your_prefix_register_meta_boxes( $meta_boxes )
{
	/**
	 * prefix of meta keys (optional)
	 * Use underscore (_) at the beginning to make keys hidden
	 * Alt.: You also can make prefix empty to disable it
	 */
	// Better has an underscore as last sign
	$prefix = 'st_';
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'cpfis_reports1','cpfis_reports2','cpfis_reports3','funds_flow_reports' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'PDF for Quarter 1', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}pdf1",
				'type'  => 'file',
				'max_file_uploads'	=> 1			
			),	
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'PDF for Quarter 2', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}pdf2",
				'type'  => 'file',
				'max_file_uploads'	=> 1			
			),	
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'PDF for Quarter 3', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}pdf3",
				'type'  => 'file',
				'max_file_uploads'	=> 1			
			),	
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'PDF for Quarter 4', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}pdf4",
				'type'  => 'file',
				'max_file_uploads'	=> 1			
			),	
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	$args = array(
		'post_type' => 'committee',
		'posts_per_page' => -1,
		 'orderby' => 'menu_order',
		 'order' => 'ASC',
	);
	$committee_list = get_posts($args);
	
	$committee[] = 'Select One';
	
	foreach($committee_list as $c)
	{
		$committee[$c->ID] = $c->post_title;
	}
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'working_group' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			array(
				'name'            => 'Layout',
				'id'              => $prefix . 'layout',
				'type'            => 'select',
				// Array of 'value' => 'Label' pairs
				'options'         => array(
					'1' => 'With Photo Format',
					'2'       => 'Without Photo Format',
				),
			),
		
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Initiative', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}code",
				'type'  => 'textarea',
				'rows' 	=> 10,
			),
		
			array(
				'name'            => 'Belong to which Committee',
				'id'              => $prefix . 'committee',
				'type'            => 'select',
				// Array of 'value' => 'Label' pairs
				'options'         => $committee,
				
			),
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Side Notes', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}sidenote",
				'type'  => 'textarea',
				'rows' 	=> 10,
			),
		
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	for($i=1;$i<=15;$i++)
	{
		$member_list[] = array(
				// Field name - Will be used as label
				'name'  => __( 'Member '.$i.' - Name', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}name".$i,
				'type'  => 'text',
				'size' 	=> 80,
			);
		
		$member_list[] = array(
				// Field name - Will be used as label
				'name'  => __( 'Member '.$i.' - Designation', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}title".$i,
				'type'  => 'text',
				'size' 	=> 80,
			);
			
			$member_list[] = array(
				// Field name - Will be used as label
				'name'  => __( 'Member '.$i.' - Company', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}company".$i,
				'type'  => 'text',
				'size' 	=> 80,
			);
		
		$member_list[] = array(
				// Field name - Will be used as label
				'name'  => __( 'Member '.$i.' - Content', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}content".$i,
				'type'  => 'textarea',
				'rows' 	=> 10,
			);
		
		
		$member_list[] = array(
				// Field name - Will be used as label
				'name'  => __( 'Member '.$i.' - Photo', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}photo".$i,
				'type'  => 'image',
				'max_file_uploads'	=> 1,
			);
		
		$member_list[] = array(
				// Field name - Will be used as label
				'name'  => __( 'Member '.$i.' - Ordering', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}order".$i,
				'type'  => 'text',
				'size'	=> 30,
			);
		
	
	}
	
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard2',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Members', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'working_group' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => $member_list,		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'committee' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			array(
				'name'            => 'Layout',
				'id'              => $prefix . 'layout',
				'type'            => 'select',
				// Array of 'value' => 'Label' pairs
				'options'         => array(
					'1' => 'With Photo Format',
					'2'       => 'Without Photo Format',
				),
			),
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Initiative', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}code",
				'type'  => 'textarea',
				'rows' 	=> 10,
			),
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Side Notes', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}sidenote",
				'type'  => 'textarea',
				'rows' 	=> 10,
			),
		
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	for($i=1;$i<=12;$i++)
	{
		$member_list2[] = array(
				// Field name - Will be used as label
				'name'  => __( 'Member '.$i.' - Name', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}name".$i,
				'type'  => 'text',
				'size' 	=> 80,
			);
		
		$member_list2[] = array(
				// Field name - Will be used as label
				'name'  => __( 'Member '.$i.' - Designation', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}title".$i,
				'type'  => 'text',
				'size' 	=> 80,
			);
			
		$member_list2[] = array(
				// Field name - Will be used as label
				'name'  => __( 'Member '.$i.' - Company', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}company".$i,
				'type'  => 'text',
				'size' 	=> 80,
			);
		
		$member_list2[] = array(
				// Field name - Will be used as label
				'name'  => __( 'Member '.$i.' - Content', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}content".$i,
				'type'  => 'textarea',
				'rows' 	=> 10,
			);
		
		$member_list2[] = array(
				// Field name - Will be used as label
				'name'  => __( 'Member '.$i.' - Photo', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}photo".$i,
				'type'  => 'image',
				'max_file_uploads'	=> 1,
			);
			
		$member_list2[] = array(
				// Field name - Will be used as label
				'name'  => __( 'Member '.$i.' - Ordering', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}order".$i,
				'type'  => 'text',
				'size'	=> 30,
			);
		
		
	
	}
	
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard2',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Members', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'consultation_respons' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		
		'fields'     => array(
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Hyperlink', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}hyperlink",
				'type'  => 'text',
				'size' 	=> 80,
			),	
		),	
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard2',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Members', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'committee' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => $member_list2,		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	
	// 1st meta box
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'the-team' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Designation', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}designation",
				'type'  => 'text',
				'size' 	=> 80,
			),	
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'executive_committee' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Designation', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}designation",
				'type'  => 'text',
				'size' 	=> 80,
			),	
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Company', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}company",
				'type'  => 'text',
				'size' 	=> 80,
			),	
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	// 1st meta box
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'events_block' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Event Date', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}date",
				'type'  => 'date',
				'size' 	=> 30,
			),	
			array(
				'name' => 'Is Featured?',
				'id'   => "{$prefix}featured",
				'type' => 'checkbox',
				'std'  => 0, // 0 or 1
			),	
			array(
				'name' => 'Without actual date',
				'id'   => "{$prefix}without_actual_date",
				'type' => 'checkbox',
				'std'  => 0, // 0 or 1
			),
			array(
				'name' => 'Hide more details text',
				'id'   => "{$prefix}hide_text",
				'type' => 'checkbox',
				'std'  => 0, // 0 or 1
			),
			
			array(
				'name' => 'Edit Details text',
				'id'   => "{$prefix}details_text",
				'type' => 'text',
				'size'  => 50,
			),
			
			array(
				'name' => 'Disable view details',
				'id'   => "{$prefix}disable_view_details",
				'type' => 'checkbox',
				'std'  => 0, // 0 or 1
			),
			
			array(
				'name' => 'Link to different URL',
				'id'   => "{$prefix}url",
				'type' => 'text',
				'size' 	=> 50,
			),
			array(
				'name' => 'Open New Window',
				'id'   => "{$prefix}new_window",
				'type' => 'checkbox',
				'std'  => 0, // 0 or 1
			),
			array(
				// Field name - Will be used as label
				'name'  => __( 'Video Embed Code', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}video",
				'type'  => 'textarea',
				'sanitize_callback'  => 'none',
				'rows' 	=> 10,
			),
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Event Image', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}images",				
				'type'  => 'image',
				'max_file_uploads'	=> 1
			),
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	// 1st meta box
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'working_groups' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Initiative', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}code",
				'type'  => 'textarea',
				'rows' 	=> 10,
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Member 1 - Name', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}name1",
				'type'  => 'text',
				'size' 	=> 80,
			),
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Member 1 - Designation', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}title1",
				'type'  => 'text',
				'size' 	=> 80,
			),
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Member 1 - Content', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}content",
				'type'  => 'textarea',
				'rows' 	=> 10,
			),	
		
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	
	// 1st meta box
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'webinars' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Embed Code', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}code",
				'type'  => 'textarea',
				'sanitize_callback'  => 'none',
				'size'  => 80,
				'rows' 	=> 10,
			),		
		
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'home_block' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Banner Link', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}link",
				'type'  => 'text',
				'size'  => 80,
			),		
		
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	// 1st meta box
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'gallery' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Photos', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}image_advanced",
				'type'  => 'image',
				'size'  => 80,
			),	
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Date', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}date",
				'type'  => 'text',
				'size'  => 80,
			),		
			
		
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'press_releases' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'News Date', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}date",
				'type'  => 'date',
				'size'  => 80,
			),		
		
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'home_banner' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Mobile Banner (750px by 820px)', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}image",
				'type'  => 'image',
				'max_file_uploads'	=> 1
			
			),	
			
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'URL', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}url",
				'type'  => 'text',
				'size'  => 80,
			),	
			array(
				'name'            => 'Open New Window',
				'id'              => $prefix . 'newwindow',
				'type'            => 'select',
				// Array of 'value' => 'Label' pairs
				'options'         => array(
					'_self' => 'No',
					'_blank'       => 'Yes',
				),
			),
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'imas-newsletter','members-publications' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
		array(
				'name'            => 'Year',
				'id'              => $prefix . 'year',
				'type'            => 'select',
				// Array of 'value' => 'Label' pairs
				'options'         => array(
					'' => '',
					'2025' => '2025',
					'2024' => '2024',
					'2023' => '2023',
					'2022' => '2022',
					'2021' => '2021',
					'2020' => '2020',
				),
			),
		
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Newsletter PDF File', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}pdf",
				'type'  => 'file',
				'max_file_uploads'	=> 1			
			),	
			
				// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Restricted PDF?', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}restrictedfile",
				'type'  => 'checkbox',
				'value'  => 1,
			),
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Restricted Newsletter PDF Filename', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}pdf2",
				'type'  => 'text',
				'size'	=> 30			
			),	
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id'         => 'standard',
		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title'      => __( 'Standard Fields', 'meta-box' ),
		// Post types, accept custom post types as well - DEFAULT is 'post'. Can be array (multiple post types) or string (1 post type). Optional.
		'post_types' => array( 'page' ),
		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context'    => 'advanced',
		// Order of meta box: high (default), low. Optional.
		'priority'   => 'high',
		// Auto save: true, false (default). Optional.
		'autosave'   => true,
		// List of meta fields
		'fields'     => array(
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Overwrite Title', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}newtitle",
				'type'  => 'text',
				'size'  => 80,
			),			
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Parent ID', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}fixed_parent_id",
				'type'  => 'text',
				'size'  => 80,
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Restricted Page', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}restricted",
				'type'  => 'checkbox',
				'value'  => 1,
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Header Banner', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}banner",
				'type'  => 'image',
				'max_file_uploads'	=> 1,
			),		
		
		
		
		),		
		'validation' => array(
			'rules'    => array(
				"{$prefix}date" => array(
					'required'  => true,
				),
				"{$prefix}pdf" => array(
					'required'  => true,
				),
			),
			// optional override of default jquery.validate messages
			'messages' => array(
				"{$prefix}password" => array(
					'required'  => __( 'Password is required', 'meta-box' ),
					'minlength' => __( 'Password must be at least 7 characters', 'meta-box' ),
				),
			)
		)
	);
	return $meta_boxes;
}