protected function PdbBlock::getElementDefaultValue in Decoupled Blocks 8
Gets the actual default field value of a given field element defaults.
Parameters
mixed $element_defaults: The element default values.
Return value
mixed The actual element default value.
1 call to PdbBlock::getElementDefaultValue()
- PdbBlock::createElementsFromConfiguration in src/
Plugin/ Block/ PdbBlock.php - Create Form API elements from component configuration.
File
- src/
Plugin/ Block/ PdbBlock.php, line 329
Class
- PdbBlock
- Class PdbBlock.
Namespace
Drupal\pdb\Plugin\BlockCode
protected function getElementDefaultValue($element_defaults) {
// @todo are there any other ways to get the actual default value?
// Some form elements like "text_format" store the default values as an
// array and the actual default value is stored on the "value" key.
if (is_array($element_defaults) && isset($element_defaults['value'])) {
return $element_defaults['value'];
}
return $element_defaults;
}