I found this in a theme for a WP blog:
Is it supposed to do something? I can't see that it is doing much of anything.PHP Code:<?php _e('Categories:'); ?>
| SitePoint Sponsor |

I found this in a theme for a WP blog:
Is it supposed to do something? I can't see that it is doing much of anything.PHP Code:<?php _e('Categories:'); ?>
It's a function that is defined by WordPress. I forget where the _e function is defined, but it's somewhere in there. It's not a PHP default function or something... it's just something that WordPress uses.


The _e function is found in the l10n.php (localization) file.
As you can see it "echoes" the string, but it allows for the text to be translated to other languages.PHP Code:function _e($text, $domain = 'default') {
echo translate($text, $domain);
}

Thanks Tipem & Mittineague.
Wonderful name for a function - that's why I had trouble finding it...


If you like that, check out the __ function. Does the same as _e except it returns the text rather than echo it.![]()

Too funny.
Makes you wonder why they didn't use __t rather than translate...

I love shortcut functions like that. Though, when I do it, i define them all in their own php file, just for shortcuts, so if anyone has any questions as to what they are, its easy to find.
Best example of shortcut ever? '$' in prototype.js for javascript....
Developer
Grow Interactive
Bookmarks