Tribe_Meta_Box::add_missed_values()

Topics


Source #

File: lib/tribe-meta-box.php

	public function add_missed_values() {
		// default values for meta box
		$this->_meta_box = array_merge( array(
			'context' => 'normal',
			'priority' => 'high',
			'pages' => array( 'post' ),
		), $this->_meta_box );

		// default values for fields
		foreach ( $this->_fields as &$field ) {
			$multiple = in_array( $field['type'], array( 'checkbox_list', 'file', 'image' ) );
			$std = $multiple ? array() : '';
			$format = 'date' == $field['type'] ? 'yy-mm-dd' : ( 'time' == $field['type'] ? 'hh:mm' : '' );

			$field = array_merge( array(
				'multiple' => $multiple,
				'std' => $std,
				'desc' => '',
				'format' => $format,
				'validate_func' => '',
			), $field );
		}
	}