You are here

function hook_social_node_message in Open Social 10.2.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_node/social_node.api.php \hook_social_node_message()
  2. 10.0.x modules/social_features/social_node/social_node.api.php \hook_social_node_message()
  3. 10.1.x modules/social_features/social_node/social_node.api.php \hook_social_node_message()

Provides message which will be displayed after saving a node.

Parameters

\Drupal\node\NodeInterface $node: The node.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup|null The message.

See also

\Drupal\social_node\Service\SocialNodeMessenger::addStatus()

1 function implements hook_social_node_message()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

social_album_social_node_message in modules/social_features/social_album/social_album.module
Implements hook_social_node_message().
1 invocation of hook_social_node_message()
SocialNodeMessenger::addStatus in modules/social_features/social_node/src/Service/SocialNodeMessenger.php
Adds a new status message to the queue.

File

modules/social_features/social_node/social_node.api.php, line 24
Hooks specific to the Social Node module.

Code

function hook_social_node_message(\Drupal\node\NodeInterface $node) {
  $t_args = [
    '@type' => node_get_type_label($node),
    '%title' => $node
      ->toLink()
      ->toString(),
  ];
  if ($node
    ->isNew()) {
    return t('@type %title has been created.', $t_args);
  }
  return t('@type %title has been updated.', $t_args);
}