Skip to content

Instantly share code, notes, and snippets.

@gspice
Forked from rickalday/make_comment_required.php
Created March 11, 2025 21:46
Show Gist options
  • Save gspice/eca9b89ca654ff2fe956de710175dbad to your computer and use it in GitHub Desktop.
Save gspice/eca9b89ca654ff2fe956de710175dbad to your computer and use it in GitHub Desktop.
Make the Commens block field required in GiveWP forms
<?php
add_action('givewp_donation_form_schema', function($form) {
$comment = $form->getNodeByName('comment');
// if the comment field is not found, return
if (!$comment) {
return;
}
// require field
$comment->required(true);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment