Skip to content

Instantly share code, notes, and snippets.

@zackkatz
Last active December 25, 2021 16:51
Show Gist options
  • Save zackkatz/303e378600acd0933a6515a3b25a8cbe to your computer and use it in GitHub Desktop.
Save zackkatz/303e378600acd0933a6515a3b25a8cbe to your computer and use it in GitHub Desktop.
GravityView - Modify text using a `gettext` filter
<?php
/**
* Modify text for GravityView
*/
add_filter( 'gettext', function( $translation = '', $text = '', $domain = '' ) {
if( 'gravityview' !== $domain ) {
return $translation;
}
// You can add or remove switch statements below:
switch( $text ) {
case 'Delete':
$translation = 'Remove'; // Update here
break;
// Text when a note is approved
case 'Approved the Entry for GravityView':
$translation = 'Entry approved!'; // UPDATE HERE
break;
}
return $translation;
}, 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment