Tribe__Context::add_locations( array $locations )
Adds/replaces read and write locations to a context.
Contents
Locations are merged with an array_merge call. To refine the locations get them first with the get_locations method.
Parameters
- $locations
-
(array) (Required) An array of read and write locations to add to the context. The array should have the same shape as the static
$locationsone:[ <location> => [ 'read' => <read_locations>, 'write' => <write_locations> ] ].
Return
(Tribe__Context) A clone of the current context with the additional read and write locations added.
Source
File: src/Tribe/Context.php
public function add_locations( array $locations ) {
$clone = clone $this;
$clone->override_locations = array_merge( $clone->override_locations, $locations );
return $clone;
}
Changelog
| Version | Description |
|---|---|
| 4.9.5 | Introduced. |