Skip to content

Instantly share code, notes, and snippets.

View spathon's full-sized avatar
⛰️
Coding in the mountains

Patrik Spathon spathon

⛰️
Coding in the mountains
View GitHub Profile

Keybase proof

I hereby claim:

  • I am spathon on github.
  • I am spathon (https://keybase.io/spathon) on keybase.
  • I have a public key whose fingerprint is DA2A 940A BCA4 650A 3070 BC3E 6626 6CE3 3C4D FD1F

To claim this, I am signing this object:

@spathon
spathon / gist:4707119
Created February 4, 2013 14:48
Hack wordpress translation
// hook the translation filters
add_filter( 'gettext', 'ps_change_post_to_article' );
add_filter( 'ngettext', 'ps_change_post_to_article' );
function ps_change_post_to_article( $translated ) {
$custom_translation = array(
array('Inlägg','Nyheter')
);
foreach($custom_translation as $c){
$translated = str_ireplace( $c[0], $c[1], $translated ); // ireplace is PHP5 only
}