function MediaEmbed::disableContextualLinks

Same name in other branches
  1. 9 core/modules/media/src/Plugin/Filter/MediaEmbed.php \Drupal\media\Plugin\Filter\MediaEmbed::disableContextualLinks()
  2. 10 core/modules/media/src/Plugin/Filter/MediaEmbed.php \Drupal\media\Plugin\Filter\MediaEmbed::disableContextualLinks()
  3. 11.x core/modules/media/src/Plugin/Filter/MediaEmbed.php \Drupal\media\Plugin\Filter\MediaEmbed::disableContextualLinks()

Disables Contextual Links for the embedded media by removing its property.

Parameters

array $build: The render array for the embedded media.

Return value

array The updated render array.

See also

\Drupal\Core\Entity\EntityViewBuilder::addContextualLinks()

File

core/modules/media/src/Plugin/Filter/MediaEmbed.php, line 434

Class

MediaEmbed
Provides a filter to embed media items using a custom tag.

Namespace

Drupal\media\Plugin\Filter

Code

public static function disableContextualLinks(array $build) {
    unset($build['#contextual_links']);
    return $build;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.