You are here

protected function Freelinking::extractAllowedPlugins in Freelinking 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/Filter/Freelinking.php \Drupal\freelinking\Plugin\Filter\Freelinking::extractAllowedPlugins()

Extract plugin names that are enabled from configuration.

Parameters

array $plugins: The array of plugin information from the settings.

Return value

array An indexed array of allowed plugin information.

2 calls to Freelinking::extractAllowedPlugins()
Freelinking::process in src/Plugin/Filter/Freelinking.php
Performs the filter processing.
Freelinking::tips in src/Plugin/Filter/Freelinking.php
Generates a filter's tip.

File

src/Plugin/Filter/Freelinking.php, line 338

Class

Freelinking
Freelinking input filter plugin.

Namespace

Drupal\freelinking\Plugin\Filter

Code

protected function extractAllowedPlugins(array $plugins) {
  return array_reduce($plugins, function (&$result, $info) {
    if ($info['enabled']) {
      $result[$info['plugin']] = $info;
    }
    return $result;
  }, []);
}