function views_get_plugin

Get an instance of a plugin.

Parameters

string $type: The plugin type, e.g., 'access' or 'display'.

string $plugin_id: The name of the plugin, e.g., 'standard'.

Return value

Drupal\views\Plugin\view\PluginBase The created plugin instance.

2 calls to views_get_plugin()
DisplayPluginBase::optionsSummary in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Provide the default summary for options in the views UI.
DisplayPluginBase::submitOptionsForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.

File

drupal/core/modules/views/views.module, line 1334
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_get_plugin($type, $plugin_id) {
  return drupal_container()
    ->get("plugin.manager.views.{$type}")
    ->createInstance($plugin_id);
}