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

Reads (gets) the value reading it from a query var parsed from the query matched by 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_matched_query( array $vars, $default ) {
		/** @var WP $wp */
		global $wp;

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

		parse_str( $wp->matched_query, $query_vars );

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

Top ↑

Changelog

Changelog
Version Description
4.9.8 Introduced.