You are here

function social_post_user_predelete in Open Social 8.4

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_post/social_post.module \social_post_user_predelete()
  2. 8.3 modules/social_features/social_post/social_post.module \social_post_user_predelete()
  3. 8.5 modules/social_features/social_post/social_post.module \social_post_user_predelete()
  4. 8.6 modules/social_features/social_post/social_post.module \social_post_user_predelete()
  5. 8.7 modules/social_features/social_post/social_post.module \social_post_user_predelete()
  6. 8.8 modules/social_features/social_post/social_post.module \social_post_user_predelete()
  7. 10.3.x modules/social_features/social_post/social_post.module \social_post_user_predelete()
  8. 10.0.x modules/social_features/social_post/social_post.module \social_post_user_predelete()
  9. 10.1.x modules/social_features/social_post/social_post.module \social_post_user_predelete()
  10. 10.2.x modules/social_features/social_post/social_post.module \social_post_user_predelete()

Implements hook_ENTITY_TYPE_predelete() for user entities.

File

modules/social_features/social_post/social_post.module, line 312
The Social post module.

Code

function social_post_user_predelete($account) {

  // Delete posts.
  $pids = \Drupal::entityQuery('post')
    ->condition('user_id', $account
    ->id())
    ->accessCheck(FALSE)
    ->execute();
  entity_delete_multiple('post', $pids);
}