path_entity_base_field_info

function path_entity_base_field_info

path_entity_base_field_info(EntityTypeInterface $entity_type)

Implements hook_entity_base_field_info().

File

core/modules/path/path.module, line 65
Enables users to rename URLs.

Code

function path_entity_base_field_info(EntityTypeInterface $entity_type) {
  if ($entity_type->id() === 'taxonomy_term' || $entity_type->id() === 'node') {
    $fields['path'] = BaseFieldDefinition::create('path')
      ->setLabel(t('URL alias'))
      ->setTranslatable(TRUE)
      ->setDisplayOptions('form', array(
        'type'