Reputation: 3
I would like to save a translated string in a variable without displaying it.
I have actually this code :
<?php $str = _e('mystring', 'myplugin' ); ?>
Any suggestions?
Upvotes: 0
Views: 100
Reputation: 9941
You can use the __()
function that returns the value. _e()
echo's the value to screen.
Use
<?php $str = __('mystring', 'myplugin' ); ?>
Upvotes: 1