There are “printf” statements all over the BuddyPress default theme. What do they mean?

Today, I decided to invest an hour into finding the answer to that question. Here is my answer.

In short, “printf” is php code used to help make themes display words and phrases from other languages. For a long answer and how-to, read this.

Here’s an example, in the BuddyPress default theme’s footer.php file, you will find the following line of code:

printf( __( '%s is proudly powered by <a href="http://wordpress.org">WordPress</a> and <a href="http://buddypress.org">BuddyPress</a>', 'buddypress' ), bloginfo('name') );

If you look at line #2963 in “buddypress –> bp-languages –> buddypress.pot”, you will see the same code as above.

Basically, these printf statements give us a central location to change certain “special” words and phrases across a BuddyPress website. For example, you might want to change all instances of “Login” to a different word (or language). You might want to change “Groups” to “Communities”, as the Custom Groups Name plugin does.

I am a beginner at this printf stuff, and that is as simple an answer as I can give right now. All you .pot and .mo gurus out there, please let me know if I misspoke at all. ūüôā



We love to communicate: phone, email, text, Facebook, Twitter, LinkedIn, you name it.




Enroll in Our Free Beginner WordPress Class - delivered to your Email Inbox!

Become a WordPress superstar for FREE in only minutes a day!  Our free Beginner WordPress Email Class will be delivered to your inbox!

Learn More 

You Have Successfully Enrolled! Prepare For Amazing!