menu_link_content.module
Same filename and directory in other branches
File
-
core/
modules/ menu_link_content/ menu_link_content.module
View source
<?php
/**
* @file
*/
/**
* Helper function to update plugin definition using internal scheme.
*
* @param string $path
* The path alias.
*
* @deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. There is no
* replacement.
*
* @see https://www.drupal.org/node/3566774
*/
function _menu_link_content_update_path_alias($path) : void {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. There is no replacement. See https://www.drupal.org/node/3566774', E_USER_DEPRECATED);
/** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */
$menu_link_manager = \Drupal::service('plugin.manager.menu.link');
/** @var \Drupal\menu_link_content\MenuLinkContentInterface[] $entities */
$entities = \Drupal::entityTypeManager()->getStorage('menu_link_content')
->loadByProperties([
'link.uri' => 'internal:' . $path,
]);
foreach ($entities as $menu_link) {
$menu_link_manager->updateDefinition($menu_link->getPluginId(), $menu_link->getPluginDefinition(), FALSE);
}
}
Functions
| Title | Deprecated | Summary |
|---|---|---|
| _menu_link_content_update_path_alias | in drupal:11.4.0 and is removed from drupal:12.0.0. There is no replacement. |
Helper function to update plugin definition using internal scheme. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.