Skip to content

Instantly share code, notes, and snippets.

@elimn
Created June 16, 2015 23:26
Show Gist options
  • Select an option

  • Save elimn/c0cab71da29472edb521 to your computer and use it in GitHub Desktop.

Select an option

Save elimn/c0cab71da29472edb521 to your computer and use it in GitHub Desktop.
MT | TEC | For churches and such, removes "kick ass" from strings
<?php
/*
* SWAPS OUT USAGES OF "KICK ASS" WITH A DIFFERENT WORD
* See the codex to learn more about WP text domains:
* http://codex.wordpress.org/Translating_WordPress#Localization_Technology
* Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'...
*/
function tribe_kick_ass_eraser ( $translations, $text, $domain ) {
// This is what we will replace "kick ass" with
$replacement_text = 'excel';
if( is_admin() && strpos($domain, 'tribe-') === 0 ) {
$text = str_ireplace('kick ass', $replacement_text, $text);
}
return $text;
}
add_filter('gettext', 'tribe_kick_ass_eraser', 20, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment