+ // Compile eventual content filter reasons
+ $filter_reasons = [];
+ if (!$is_preview && public_contact() != $item['author-id']) {
+ if (!empty($item['content-warning']) && (!local_user() || !DI::pConfig()->get(local_user(), 'system', 'disable_cw', false))) {
+ $filter_reasons[] = DI::l10n()->t('Content warning: %s', $item['content-warning']);
+ }
+
+ $item['attachments'] = $attachments;
+
+ $hook_data = [
+ 'item' => $item,
+ 'filter_reasons' => $filter_reasons
+ ];
+ Hook::callAll('prepare_body_content_filter', $hook_data);
+ $filter_reasons = $hook_data['filter_reasons'];
+ unset($hook_data);
+ }
+