Last active
December 25, 2021 16:51
-
-
Save zackkatz/303e378600acd0933a6515a3b25a8cbe to your computer and use it in GitHub Desktop.
GravityView - Modify text using a `gettext` filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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