You are here

public static function Freelinking::extractPluginSettings 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::extractPluginSettings()

Extract plugin information from freelinking plugin settings.

Parameters

string $plugin_name: The plugin ID.

array $plugins: The plugin array with settings.

Return value

array The plugin information.

2 calls to Freelinking::extractPluginSettings()
Freelinking::process in src/Plugin/Filter/Freelinking.php
Performs the filter processing.
Freelinking::settingsForm in src/Plugin/Filter/Freelinking.php
Generates a filter's settings form.

File

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

Class

Freelinking
Freelinking input filter plugin.

Namespace

Drupal\freelinking\Plugin\Filter

Code

public static function extractPluginSettings($plugin_name, array $plugins) {
  return array_reduce($plugins, function (&$result, $info) use ($plugin_name) {
    if ($info['plugin'] === $plugin_name) {
      $result = $info;
    }
    return $result;
  }, []);
}