Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //* Please do NOT include the opening php tag, except of course if you're starting with a blank file
- function mycustom_filter_gettext( $translated, $original, $domain ) {
- // This is an array of original strings
- // and what they should be replaced with
- $strings = array(
- //'Original string' => 'Translated string',
- 'Add to iCal Calendar' => 'Add to Calendar',
- // Add some more strings here
- );
- // See if the current string is in the $strings array
- // If so, replace its translation
- if ( isset( $strings[$original] ) ) {
- // This accomplishes the same thing as __()
- // but without running it through the filter again
- $translations = get_translations_for_domain( $domain );
- $translated = $translations->translate( $strings[$original] );
- }
- return $translated;
- }
- add_filter( 'gettext', 'mycustom_filter_gettext', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement