Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress How to Make a Website with WordPress WordPress Widgets and Custom Menus How to Add Custom Menus to a WordPress Theme

Ok, I can't ignore it. What is the deal with the double underscores?!

Are the double underscores a WP thing or PHP thing or what? What do they mean?

2 Answers

Sidney François
Sidney François
2,092 Points

Apparently has to do with localisation. I am not good enough of a PHP programmer to explain it to you, but may this article will enlighten you.

(Also, on StackOverflow.)

I guess it's just a way to write it so that it can ready to be translated to other languages just in case?

Is it necessary to use __( ' string ' ) ???

Sidney François
Sidney François
2,092 Points

Well, it appears to be a "special" kind of naming a variable. Technically yes, you could probably just name your variable the conventional way. But why would you want to do it, if it is supportive of localisation. It looks heinous, sure, but it gets the job done just as well.