You are here

function social_album_social_post_message_alter in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_album/social_album.module \social_album_social_post_message_alter()
  2. 10.0.x modules/social_features/social_album/social_album.module \social_album_social_post_message_alter()
  3. 10.2.x modules/social_features/social_album/social_album.module \social_album_social_post_message_alter()

Implements hook_social_post_message_alter().

File

modules/social_features/social_album/social_album.module, line 238
The Social Album module.

Code

function social_album_social_post_message_alter(TranslatableMarkup &$message, FormStateInterface $form_state) {
  if ($form_state
    ->has('album')) {
    $post = $form_state
      ->getFormObject()
      ->getEntity();
    if (!$post->field_album
      ->isEmpty()) {
      $message = t('You have posted successfully in your new album @link', [
        '@link' => $post->field_album->entity
          ->toLink()
          ->toString(),
      ]);
    }
  }
}