0

I'm creating a wordpress theme in which I'm creating a shortcode for a video. Part of the output of this shortcode is something like this:

   $result .= '<video class="fullWidth" width="auto" height="auto" loop muted preload>';
    $result .= '<source src="'.$mp4.'" type="video/mp4" />';
    $result .= '<source src="'.$webm.'" type="video/webm" />';
    $result .= '<source src="'.$ogv.'" type="video/ogv" />';
    $result .= _e('Video tag is not supported in your browser.', 'my-theme-framework');
   $result .= '</video>';

Now the video is working but the text 'Vide tag is ...' is getting echoed out, but when I remove the text from the function, it gets hidden. So I believe it is because of the _e() function and I do not know what to do. I need that to make the text translation ready, should I remove it?

I've searched around for this, but I'm getting no relevant results. Please tell me if you know what I should do here.

Thank you.

5

_e() echoes the translated string, which will not work in variable assignment. You need to use __(), which returns the translated string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.