Posted By

nathanbweb on 05/11/11


Tagged

php wordpress


Versions (?)

WordPress change 'Posts' to 'Articles'


 / Published in: PHP
 

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

  1. // Change 'Posts' to 'Articles'
  2. // via bit.ly/smag-wp31tips
  3. // hook the translation filters
  4. add_filter( 'gettext', 'change_post_to_article' );
  5. add_filter( 'ngettext', 'change_post_to_article' );
  6.  
  7. function change_post_to_article( $translated ) {
  8. $translated = str_ireplace( 'Post', 'Article', $translated ); // ireplace is PHP5 only
  9. return $translated;
  10. }

Report this snippet  

You need to login to post a comment.