Skip to content

Instantly share code, notes, and snippets.

@kimcoleman
Created December 12, 2024 15:27
Show Gist options
  • Save kimcoleman/7f90ed5cab1b36d2be292424c2039d8d to your computer and use it in GitHub Desktop.
Save kimcoleman/7f90ed5cab1b36d2be292424c2039d8d to your computer and use it in GitHub Desktop.
Changing frontend plugin text using gettext filter. Used for the Condo Owner's Association Demo at https://coa.pmproplugin.com/
<?php
function my_coa_demo_pmpro_gettext_changes( $translated_text, $text, $domain ) {
if ( $domain == 'pmpro-shipping' ) {
if ( $text == 'Shipping Address' ) {
$translated_text = 'Mailing Address';
}
}
return $translated_text;
}
add_filter( 'gettext', 'my_coa_demo_pmpro_gettext_changes', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment