Saturday, 5 December 2015

What is use of __() and _e() functions in wordpress?

These are function used when you website multilingual.
each of this function have two parameter.
1st parameter: String which you want to convert from one language to another.
2nd parameter: domain name.

 $translatedText = __( 'TEXT_FOR_TRANSLATION', 'textdomain' ); //This will return the translated text
 _e( 'TEXT_FOR_TRANSLATION', 'textdomain' ); //This will print the translated text

No comments:

Post a Comment