Tribe__Context::set_locations( array $locations, bool $use_default_locations = true )

Sets, replacing them, the locations used by this context.


Parameters

$locations

(array) (Required) An array of locations to replace the current ones.

$use_default_locations

(bool) (Optional) Whether the context should use the default locations defined in the static $locations property or not.

Default value: true


Top ↑

Return

(Tribe__Context) A clone of the current context with modified locations.


Top ↑

Source

File: src/Tribe/Context.php

	public function set_locations( array $locations, $use_default_locations = true ) {
		$clone                        = clone $this;
		$clone->override_locations    = $locations;
		$clone->use_default_locations = (bool) $use_default_locations;

		return $clone;
	}

Top ↑

Changelog

Changelog
Version Description
4.9.5 Introduced.