ValueLoader::get( $key = null, $default = null )
Get a value by key
Description
Source
File: bp-integrations/learndash/library/ValueLoader.php
public function get($key = null, $default = null)
{
$target = $this->value;
if (is_null($key)) {
return $target;
}
if (isset($target[$key])) {
return $target[$key];
}
foreach (explode('.', $key) as $segment) {
if (! is_array($target) || ! array_key_exists($segment, $target)) {
return $default;
}
$target = $target[$segment];
}
return $target;
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.