Skip to content

Instantly share code, notes, and snippets.

@rickalday
Created March 11, 2025 20:18
Show Gist options
  • Save rickalday/d9d4899108970f983024fef90be05a4c to your computer and use it in GitHub Desktop.
Save rickalday/d9d4899108970f983024fef90be05a4c 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