Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

The 'label' property in hook_field_extra_fields() is no longer sanitized on output. It is now the responsibility of implementations of hook_field_extra_fields() to sanitize this string themselves.

This allows modules to use t() with placeholders in the label for extra fields.

Before:

  foreach (node_type_get_types() as $bundle) {
    if ($bundle->has_title) {
      $extra['node'][$bundle->type]['form']['title'] = array(
        'label' => $bundle->title_label,
        'description' => $description,
        'weight' => -5,
      );
    }
  }

After:

  foreach (node_type_get_types() as $bundle) {
    if ($bundle->has_title) {
      $extra['node'][$bundle->type]['form']['title'] = array(
        'label' => t('Yay for labels - my label is: %label', array('%label' => $bundle->title_label)),
        'description' => $description,
        'weight' => -5,
      );
    }
  }

Note that if the label is not created by new FormattableMarkup() or t() it will be autoescaped by Twig.

Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done