Return to Snippet

Revision: 46029
at May 11, 2011 23:35 by nathanbweb


Initial Code
// Change 'Posts' to 'Articles'
// via bit.ly/smag-wp31tips
// hook the translation filters
add_filter(  'gettext',  'change_post_to_article'  );
add_filter(  'ngettext',  'change_post_to_article'  );

function change_post_to_article( $translated ) {
     $translated = str_ireplace(  'Post',  'Article',  $translated );  // ireplace is PHP5 only
     return $translated;
}

Initial URL
http://bit.ly/smag-wp31tips

Initial Description

                                

Initial Title
WordPress change 'Posts' to 'Articles'

Initial Tags
php, wordpress

Initial Language
PHP