You are here

facets_block.api.php in Facets Block 8

Describes hooks and plugins provided by the Facets Block module.

File

facets_block.api.php
View source
<?php

/**
 * @file
 * Describes hooks and plugins provided by the Facets Block module.
 */
use Drupal\Core\Link;
use Drupal\Core\Url;

/**
 * @file
 * Hooks specific to the Facets Block module.
 */

/**
 * Alter the facets array.
 *
 * @param array $facets
 *   The facets array.
 */
function hook_facets_block_facets_alter(array &$facets) {
  $facets[] = [
    'title' => '',
    'content' => Link::fromTextAndUrl(t('Home page'), Url::fromRoute('<front>', [], [
      'query' => [
        'filter' => 'recent-posts',
      ],
    ])),
  ];
}

Functions

Namesort descending Description
hook_facets_block_facets_alter Alter the facets array.