You are here

social_topic.api.php in Open Social 8.3

Hooks provided by the Social_topic module.

File

modules/social_features/social_topic/social_topic.api.php
View source
<?php

/**
 * @file
 * Hooks provided by the Social_topic module.
 */

/**
 * @addtogroup hooks
 * @{
 */

/**
 * Provide a method to alter the titles of the topic view.
 *
 * @param string $title
 *   The default generated view title for the term.
 * @param \Drupal\taxonomy\Entity\Term $term
 *   The topic type term that is selected in the filter. NULL if none is
 *   selected.
 *
 * @ingroup social_topic_api
 */
function hook_topic_type_title_alter(&$title, \Drupal\taxonomy\Entity\Term &$term) {
  if (isset($term)) {
    $term_title = $term
      ->getName();
    $title = t('@type', [
      '@type' => $term_title,
    ]);
  }
  else {
    $title = t("Newest content");
  }
}

/**
 * @} End of "addtogroup hooks".
 */

Functions

Namesort descending Description
hook_topic_type_title_alter Provide a method to alter the titles of the topic view.