Created
March 11, 2025 20:18
-
-
Save rickalday/d9d4899108970f983024fef90be05a4c to your computer and use it in GitHub Desktop.
Make the Commens block field required in GiveWP forms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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