Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Created May 20, 2021 19:50
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 kjohnson/6f3016737efc6e03f4071575e7d839f8 to your computer and use it in GitHub Desktop.
Save kjohnson/6f3016737efc6e03f4071575e7d839f8 to your computer and use it in GitHub Desktop.
wp.hooks.addFilter(
'i18n.gettext',
'myplugin/filter-gettext',
function( translation, text, domain ) {
if ( 'Your Giving Stats' === text && 'give' === domain ) {
return 'YOUR TEST HERE'
}
return translation;
}
);
<?php
/**
* Plugin Name: GiveWP Donor Dashboard Custom Translations
*/
add_action( 'give_embed_head', function() {
wp_enqueue_script('my-i18n', plugin_dir_url(__FILE__) . 'index.js' );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment