Skip to content

Instantly share code, notes, and snippets.

@Benunc
Created September 16, 2022 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Benunc/6eaa0d5aa685897fe14988e52de8b5aa to your computer and use it in GitHub Desktop.
Save Benunc/6eaa0d5aa685897fe14988e52de8b5aa to your computer and use it in GitHub Desktop.
<?php
function my_give_comment_text_switcher( $translations, $text, $domain ) {
// changes the "Donations" text in multiple places
if ( $domain == 'give' && $text == 'Comment' ) {
$translations = __( 'TITLE', 'give' );
}
// changes the "Make this Donation [monthly/weekly/daily]"
// text for a donor's choice recurring checkbox
if ( $domain == 'give' && $translations == 'Leave a comment' ) {
$translations = __( 'YOUR TEXT HERE', 'give' );
}
return $translations;
}
add_filter( 'gettext', 'my_give_comment_text_switcher', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment