Tribe__Context::wp_parsed( array $vars, mixed $default )

Reads (gets) the value reading it from a query var parsed from the global $wp object.


Parameters

$vars

(array) (Required) The list of variables to read, in order.

$default

(mixed) (Required) The default value to return if no variable was parsed.


Top ↑

Return

(mixed) The first valid value found or the default value.


Top ↑

Source

File: src/Tribe/Context.php

	public function wp_parsed( array $vars, $default ) {
		/** @var WP $wp */
		global $wp;

		if ( ! $wp instanceof WP || empty($wp->query_vars) ) {
			return $default;
		}

		return Arr::get_first_set( (array) $wp->query_vars, $vars, $default );
	}

Top ↑

Changelog

Changelog
Version Description
4.9.8 Introduced.