FieldConfigBase::$default_value_callback

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/FieldConfigBase.php \Drupal\Core\Field\FieldConfigBase::default_value_callback
  2. 8.9.x core/lib/Drupal/Core/Field/FieldConfigBase.php \Drupal\Core\Field\FieldConfigBase::default_value_callback
  3. 10 core/lib/Drupal/Core/Field/FieldConfigBase.php \Drupal\Core\Field\FieldConfigBase::default_value_callback

The name of a callback function that returns default values.

The function will be called with the following arguments:

It should return an array of default values, in the same format as the $default_value property.

This property takes precedence on the list of fixed values specified in the $default_value property.

Type: string

File

core/lib/Drupal/Core/Field/FieldConfigBase.php, line 164

Class

FieldConfigBase
Base class for configurable field definitions.

Namespace

Drupal\Core\Field

Code

protected $default_value_callback = '';

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.