Tribe__Context::alter( array $values )

Alters the context.

Due to its immutable nature setting values on the context will NOT modify the context but return a modified clone. If you need to modify the global context update the location(s) it should read from and call the refresh method. Example: $widget_context = tribe_context()->alter( $widget_args );.


Parameters

$values

(array) (Required) An associative array of key-value pairs to modify the context.


Top ↑

Return

(Tribe__Context) A clone, with modified, values, of the context the method was called on.


Top ↑

Source

File: src/Tribe/Context.php

	public function alter( array $values  ) {
		$clone = clone $this;

		$clone->request_cache = array_merge( $clone->request_cache, $values );

		return $clone;
	}

Top ↑

Changelog

Changelog
Version Description
4.9.5 Introduced.