Tribe__Context::wp_parsed( array $vars, mixed $default )
Reads (gets) the value reading it from a query var parsed from the global $wp object.
Contents
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.
Return
(mixed) The first valid value found or the default value.
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 );
}
Changelog
| Version | Description |
|---|---|
| 4.9.8 | Introduced. |