block_content_add_body_field($block_type_id, $label = 'Body')
Adds the default body field to a custom block type.
Parameters
string $block_type_id: Id of the block type.
string $label: (optional) The label for the body instance. Defaults to 'Body'
Return value
\Drupal\field\Entity\FieldConfig A Body field object.
File
core/modules/block_content/block_content.module, line 78 Allows the creation of custom blocks through the user interface.
Code
function block_content_add_body_field($block_typ