Tribe__Context::add_locations( array $locations )

Adds/replaces read and write locations to a context.

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 $locations one: [ <location> => [ 'read' => <read_locations>, 'write' => <write_locations> ] ].


Top ↑

Return

(Tribe__Context) A clone of the current context with the additional read and write locations added.


Top ↑

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;
	}

Top ↑

Changelog

Changelog
Version Description
4.9.5 Introduced.