Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. OptionsWidgetBase.php

function OptionsWidgetBase::sanitizeLabel

Sanitizes a string label to display as an option.

Parameters

string $label: The label to sanitize.

1 method overrides OptionsWidgetBase::sanitizeLabel()
OptionsSelectWidget::sanitizeLabel in core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsSelectWidget.php
Sanitizes a string label to display as an option.

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php, line 214

Class

OptionsWidgetBase
Base class for the 'options_*' widgets.

Namespace

Drupal\Core\Field\Plugin\Field\FieldWidget

Code

protected function sanitizeLabel(&$label) {
    // Allow a limited set of HTML tags.
    $label = FieldFilteredMarkup::create($label);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal