Without using a language file, which file would I go to if I wanted to rename profile tabs? For example, instead of the tab saying “Activity” I want it to say “My Activity”. Instead of “Groups” I would make it say “My Groups” etc. Thanks
Leave a Reply
You must be logged in to post a comment.
Look at the source, you know that already. 🙂
I didn’t but I bet there is a piece of code looking like this:
… or …
Follow the functions, they are wrappers for the function
translate()
inwp-includes/l10n.php
:You see you get a filter:
'gettext'
with three arguments (or parameters). Now you can use the filter to change the output.Add this to your theme’s
functions.php
or to a plugin:Now we need the custom function, that’s really simple:
I dug into the code a little bit and found what looks like the “right way” to do it:
This is better than hooking into
'gettext'
, because the'gettext'
filter is called very often and so hooking into it can degrade performance.