View::set_url( array|null $args = null, bool $merge = false )

Sets a View URL object either from some arguments or from the current URL.


Parameters

$args

(array|null) (Optional) An associative array of arguments that will be mapped to the corresponding query arguments by the View, or null to use the current URL.

Default value: null

$merge

(bool) (Optional) Whether to merge the arguments or override them.

Default value: false


Top ↑

Source

File: src/Tribe/Views/V2/View.php

	public function set_url( array $args = null, $merge = false ) {
		if ( null !== $args ) {
			$query_args = $this->map_args_to_query_args( $args );
			$this->url = false === $merge ?
				new Url( add_query_arg( $query_args ) )
				: $this->url->add_query_args( $query_args );

			return;
		}

		$this->url = new Url();
	}

Top ↑

Changelog

Changelog
Version Description
4.9.3 Introduced.