<?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( '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' ),

				),

			)

		)

	);
	
	
	$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( 'rating' ),


		// 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'  => __( 'Person Name', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}name",
				'type'  => 'text',
			),	
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'i want to be anonymous', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}hidename",
				'type'  => 'checkbox',
			),	
			
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Rating', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}rating",
				'type'  => 'text',
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Review', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}review",
				'type'  => 'textarea',
				'rows'	=> 6
			),
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Date Submission', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}date",
				'type'  => 'date',
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Company ID', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}companyid",
				'type'  => 'text',
			),	
		
		),		

		'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( 'industry_insights' ),


		// 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'  => __( 'Date', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}date",
				'type'  => 'date',
			),	
		
		
		),		

		'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( 'polls' ),


		// 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'  => __( 'Choice 1', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}choice1",
				'type'  => 'text',
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Choice 2', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}choice2",
				'type'  => 'text',
			),	
			
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Choice 3', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}choice3",
				'type'  => 'text',
			),	
			
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Choice 4', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}choice4",
				'type'  => 'text',
			),	
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'To show on the website', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}display",
				'type'  => 'checkbox',
				'value'  => 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' ),

				),

			)

		)

	);
	
	
	
	
	$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( 'problem_statement_su' ),


		// 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'  => __( 'Contact Person', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}field1",
				'type'  => 'text',
				'size'  => 50,
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Email Address', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}field2",
				'type'  => 'text',
				'size'  => 50,
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Company', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}field3",
				'type'  => 'text',
				'size'  => 50,
			),	
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Problem Statements', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}field4",
				'type'  => 'textarea',
				'rows'  => 8,
			),	
		
		
		),		

		'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( 'problem_statement' ),


		// 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'  => __( 'Challenge Brief', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}brief",
				'type'  => 'file',
				'max_file_uploads'	=> 1,
			),			
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Video Link', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}link",
				'type'  => 'text',
				'size'	=> 80,
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Total votes', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}votes",
				'type'  => 'text',
				'size'	=> 80,
				'std'	=> 0,
			),	
		
		
		),		

		'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( 'company' ),


		// 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(
				// Field name - Will be used as label
				'name'  => __( 'Is Featured', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}featured",
				'type'  => 'checkbox',
				'value'  => 1,
			),	
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Average Rating', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}average_rating",
				'type'  => 'text',
			),	
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Company Website', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}website",
				'type'  => 'text',
				'size'	=> 60
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Description', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}description",
				'type'  => 'textarea',
				'rows' => '6'
			),			
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Key Innovation (Technology)', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}key_innovation",
				'type'  => 'text',
				'size'	=> 80,
			),	
			array(
				// Field name - Will be used as label
				'name'  => __( 'Key Functions That Solution can Solve', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}key_functions",
				'type'  => 'textarea',
				'rows' => '6'
			),		
		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Solution Lifecycle', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}lifecycle",
				'type'  => 'textarea',
				'rows' => '6'
			),	
			array(
				// Field name - Will be used as label
				'name'  => __( 'Founder\'s Name', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}founder_name",
				'type'  => 'textarea',
				'rows' => '6'
			),	
			array(
				// Field name - Will be used as label
				'name'  => __( 'Founder\'s Background', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}founder_background",
				'type'  => 'textarea',
				'rows' => '6'
			),				
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Founded (Years of Incorporation)', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}year_incorporation",
				'type'  => 'text',
				'size'	=> 80,
			),			
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Money Raised', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}money_raised",
				'type'  => 'text',
				'size'	=> 80,
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Employees', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}employees",
				'type'  => 'text',
				'size'	=> 80,
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Presense In Regions', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}regions",
				'type'  => 'text',
				'size'	=> 80,
			),		
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'HQ Country', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}hq_country",
				'type'  => 'text',
				'size'	=> 80,
			),	
			array(
				// Field name - Will be used as label
				'name'  => __( 'What are the top 3 key benefits your solution will bring to the Asset Management Industry', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}top_3",
				'type'  => 'textarea',
				'rows' => '6'
			),	
			array(
				// Field name - Will be used as label
				'name'  => __( 'Past client engagements', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}past_client",
				'type'  => 'textarea',
				'rows' => '6'
			),	
			array(
				// Field name - Will be used as label
				'name'  => __( 'Case Study', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}casestudy",
				'type'  => 'textarea',
				'rows' => '6'
			),	
			array(
				// Field name - Will be used as label
				'name'  => __( 'Awards/Accolades', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}awards",
				'type'  => 'textarea',
				'rows' => '6'
			),	
			
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Marketing Videos', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}video",
				'type'  => 'textarea',
				'rows'	=> 6,
			),
			// TEXT		
			array(
				// Field name - Will be used as label
				'name'  => __( 'Marketing Brochures', 'meta-box' ),	
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}brochures",
				'type'  => 'file',
				'max_file_uploads'	=> 3,
			),
		
		),		

		'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;

}