Skip to content

Instantly share code, notes, and snippets.

@kopepasah
Created March 26, 2013 15:22
Show Gist options
  • Save kopepasah/5246225 to your computer and use it in GitHub Desktop.
Save kopepasah/5246225 to your computer and use it in GitHub Desktop.
This gist was "forked" from Eric Mann (https://gist.github.com/ericmann/5245768).
<?php
/**
* Rename 'posts' to 'articles'
*/
function posts_to_articles( $translated ) {
$words = array(
// 'word to translate' = > 'translation'
'Posts' => 'Articles',
'Post' => 'Article',
);
$translated = str_ireplace( array_keys( $words ), $words, $translated );
return $translated;
}
add_filter( 'gettext', 'posts_to_articles' );
add_filter( 'ngettext', 'posts_to_articles' );
add_filter( 'gettext_with_context', 'posts_to_articles' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment