clear.php 407 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * Delete all notifications regardless if they're read or not
  4. *
  5. * @package Notifier
  6. */
  7. $user_guid = elgg_get_logged_in_user_guid();
  8. $notifications = elgg_get_entities(array(
  9. 'type' => 'object',
  10. 'subtype' => 'notification',
  11. 'owner_guid' => $user_guid,
  12. 'limit' => false
  13. ));
  14. foreach ($notifications as $item) {
  15. $item->delete();
  16. }
  17. system_message(elgg_echo('notifier:message:deleted_all'));