Tribe__Context::to_array()

Returns an array representation of the context.


Return

(array) An associative array of the context keys and values.


Top ↑

Source

File: src/Tribe/Context.php

	public function to_array(  ) {
		$locations = array_keys( array_merge( $this->get_locations(), $this->request_cache ) );
		$dump      = array();

		foreach ( $locations as $location ) {
			$the_value = $this->get( $location, self::NOT_FOUND );

			if ( self::NOT_FOUND === $the_value ) {
				continue;
			}

			$dump[ $location ] = $the_value;
		}

		return $dump;
	}

Top ↑

Changelog

Changelog
Version Description
4.9.5 Introduced.