function BlockContentAddLocalAction::getOptions
Overrides LocalActionDefault::getOptions
File
- 
              core/modules/ block_content/ src/ Plugin/ Menu/ LocalAction/ BlockContentAddLocalAction.php, line 45 
Class
- BlockContentAddLocalAction
- Modifies the 'Add content block' local action.
Namespace
Drupal\block_content\Plugin\Menu\LocalActionCode
public function getOptions(RouteMatchInterface $route_match) {
  $options = parent::getOptions($route_match);
  // If the route specifies a theme, append it to the query string.
  if ($theme = $route_match->getParameter('theme')) {
    $options['query']['theme'] = $theme;
  }
  // If the current request has a region, append it to the query string.
  if ($region = $this->requestStack
    ->getCurrentRequest()->query
    ->getString('region')) {
    $options['query']['region'] = $region;
  }
  return $options;
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
