You are here

function search_api_views_plugins_argument_alter in Search API 8

Implements hook_views_plugins_argument_alter().

File

./search_api.module, line 381
Provides a rich framework for creating searches.

Code

function search_api_views_plugins_argument_alter(array &$plugins) {

  // We have to include the term argument handler like this, since adding it
  // directly (i.e., with an annotation) would cause fatal errors on sites
  // without the Taxonomy module.
  if (\Drupal::moduleHandler()
    ->moduleExists('taxonomy')) {
    $plugins['search_api_term'] = [
      'plugin_type' => 'argument',
      'id' => 'search_api_term',
      'class' => TermArgument::class,
      'provider' => 'search_api',
    ];
    $plugins['search_api_all_terms'] = [
      'plugin_type' => 'argument',
      'id' => 'search_api_all_terms',
      'class' => SearchApiAllTerms::class,
      'provider' => 'search_api',
    ];
  }
}