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

Breadcrumb

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

function MediaLibraryWidget::preRenderWidget

Prepares the widget's render element for rendering.

Parameters

array $element: The element to transform.

Return value

array The transformed element.

See also

::formElement()

File

core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php, line 613

Class

MediaLibraryWidget
Plugin implementation of the 'media_library_widget' widget.

Namespace

Drupal\media_library\Plugin\Field\FieldWidget

Code

public function preRenderWidget(array $element) {
    if (isset($element['open_button'])) {
        $element['#field_suffix']['open_button'] = $element['open_button'];
        unset($element['open_button']);
    }
    return $element;
}

API Navigation

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