Tribe__Context::alter( array $values )
Alters the context.
Contents
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.
Return
(Tribe__Context) A clone, with modified, values, of the context the method was called on.
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; }
Changelog
Version | Description |
---|---|
4.9.5 | Introduced. |