function submitted_by_process_comment in Submitted By 7
Implements hook_process_comment().
Use hook_process_comment() rather than hook_preprocess_comment() as themes might override the submitted variable unconditionally.
File
- ./
submitted_by.module, line 236 - Take over the "Submitted by" theme function.
Code
function submitted_by_process_comment(&$variables) {
$comment = $variables['elements']['#comment'];
$view_mode = $variables['elements']['#view_mode'];
// Make submitted info empty, if user is showing module's submitted
// informaiton.
$fields = field_extra_fields_get_display('comment', $comment->node_type, $view_mode);
if (isset($fields['submitted_by']['visible']) && $fields['submitted_by']['visible']) {
$variables['display_submitted'] = FALSE;
$variables['submitted'] = '';
}
else {
// $variables['submitted'] = submitted_by_do_replace($comment, '', 'comment');
$submitted = submitted_by_do_replace($comment, '', 'comment');
if (!empty($submitted)) {
$variables['submitted'] = $submitted;
}
}
}