function social_ajax_comments_form_comment_comment_delete_form_alter in Open Social 10.3.x
Same name and namespace in other branches
- 8.9 modules/custom/social_ajax_comments/social_ajax_comments.module \social_ajax_comments_form_comment_comment_delete_form_alter()
- 8.8 modules/custom/social_ajax_comments/social_ajax_comments.module \social_ajax_comments_form_comment_comment_delete_form_alter()
- 10.0.x modules/custom/social_ajax_comments/social_ajax_comments.module \social_ajax_comments_form_comment_comment_delete_form_alter()
- 10.1.x modules/custom/social_ajax_comments/social_ajax_comments.module \social_ajax_comments_form_comment_comment_delete_form_alter()
- 10.2.x modules/custom/social_ajax_comments/social_ajax_comments.module \social_ajax_comments_form_comment_comment_delete_form_alter()
Implements hook_form_FORM_ID_alter().
Triggers on form for deleting a comment on a node.
File
- modules/
custom/ social_ajax_comments/ social_ajax_comments.module, line 83 - The Social AJAX comments module.
Code
function social_ajax_comments_form_comment_comment_delete_form_alter(&$form, FormStateInterface $form_state, $form_id) {
// We set a new class, so we can remove wrapper div.
// Due to the form.inc and confirm-form twig setup.
if (\Drupal::request()
->isXmlHttpRequest()) {
$form['#attributes']['class'][] = 'is_modal';
}
}