Tribe__Context::get_read_key_for( string $location, string|null $type = null )
Returns the first key, if there are many, that will be used to read a location.
Contents
The type ar
Parameters
- $location
-
(string) (Required) The location to get the read key for.
- $type
-
(string|null) (Optional) The type of read location to return the key for; default to
static::REQUEST_VAR
.Default value: null
Return
(string) Either the first key for the type of read location, or the input location if not found.
Source
File: src/Tribe/Context.php
public function get_read_key_for( $location, $type = null ) { $type = $type ?: static::REQUEST_VAR; if ( isset( static::$locations[ $location ]['read'][ $type ] ) ) { $keys = (array) static::$locations[ $location ]['read'][ $type ]; return reset( $keys ); } return $location; }
Changelog
Version | Description |
---|---|
4.9.20 | Introduced. |