Tribe__Tickets_Plus__Meta__Field__Abstract_Field::get_hashed_options_map()

Create a lookup map to use when rendering front-end input names as well as saving submitted data, allowing us to find which submitted/hashed field option should be assigned the value.

Used for Checkbox and Radio inputs in /wp-content/plugins/event-tickets-plus/src/views/meta/…


Return #

(array) Key is the hash. Value is the text displayed to user. Key and value get saved (serialized) to post_meta so need to stay in this format for backwards compatibility (since 4.10.2 on Checkboxes and Radios).


Top ↑

Source #

File: src/Tribe/Meta/Field/Abstract_Field.php

	public function get_hashed_options_map() {
		$map = [];

		if ( ! empty( $this->extra['options'] ) ) {
			foreach ( $this->extra['options'] as $option ) {
				$hash = esc_attr(
					$this->slug
					. '_'
					. md5( sanitize_title( $option ) )
				);

				$map[ $hash ] = wp_kses_post( $option );
			}
		}

		return $map;
	}

Top ↑

Changelog #

Changelog
Version Description
4.10.7 Introduced.