Technical Docs

Search Documentation

Function: tribe_get_var

Returns the value of a registered variable.

Located at src/Tribe/Container.php (Line: 214)

Description

Example use:

 tribe_set_var( 'tec.url', 'http://example.com' );  $url = tribe_get_var( 'tec.url' );

Parameters summary

(string) $slug The slug of the variable registered using <code>tribe_set_var</code>.
(null) $default The value that should be returned if the variable slug is not a registered one.

Return value summary

(mixed) Either the registered value or the default value if the variable is not registered.

Examples

mixed tribe_get_var ( string $slug, null $default = null )