public function metatag_handler_field_serialized::get_nested_value in Metatag 7
Retrieves a nested value from an array.
Parameters
array $value: An array of meta tag values.
string $path: The path to search for.
Return value
string|null The matching string, otherwise NULL.
2 calls to metatag_handler_field_serialized::get_nested_value()
- metatag_handler_field_serialized::get_default_value in views/
metatag_handler_field_serialized.inc - metatag_handler_field_serialized::get_value in views/
metatag_handler_field_serialized.inc - Get the value that's supposed to be rendered.
File
- views/
metatag_handler_field_serialized.inc, line 123
Class
Code
public function get_nested_value(array $value, $path) {
foreach ($path as $index) {
if (!isset($value[$index])) {
return NULL;
}
$value = $value[$index];
}
return $value;
}