Skip to content

Instantly share code, notes, and snippets.

@matheuswd
Last active February 13, 2023 21:34
Show Gist options
  • Save matheuswd/31c087d45c5c264e4a070973bc8b8977 to your computer and use it in GitHub Desktop.
Save matheuswd/31c087d45c5c264e4a070973bc8b8977 to your computer and use it in GitHub Desktop.
<?php
function my_give_limit_comment_length() { ?>
<script>
let comments = document.querySelectorAll('textarea#give-comment');
comments.forEach(comment => comment.setAttribute('maxlength', 255));
</script>
<?php }
add_action( 'give_donation_form_after_submit', 'my_give_limit_comment_length' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment