Tribe__Validate::options_with_label()

validates fields that have options (radios, dropdowns, etc.) by making sure the value is part of the options array then combines the value into an array containing the value and name from the option


Source

File: src/Tribe/Validate.php

		public function options_with_label() {
			if ( array_key_exists( $this->value, $this->field['options'] ) ) {
				$this->value         = ( $this->value === 0 ) ? false : array(
					$this->value,
					$this->field['options'][ $this->value ],
				);
				$this->result->valid = true;
			} else {
				$this->result->valid = false;
				$this->result->error = sprintf( esc_html__( "%s must have a value that's part of its options.", 'tribe-common' ), $this->label );
			}
		}