Bird
0
0

Which function is used to make a string translatable in a WordPress theme without immediately displaying it?

easy📝 Conceptual Q11 of 15
Wordpress - Custom Theme Development
Which function is used to make a string translatable in a WordPress theme without immediately displaying it?
A<code>translate_text()</code>
B<code>_e()</code>
C<code>load_theme_textdomain()</code>
D<code>__()</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand translation functions

    __() returns the translated string without printing it, while _e() echoes it immediately.
  2. Step 2: Identify the function that returns the string

    Since the question asks for making a string translatable without displaying it, __() is the correct choice.
  3. Final Answer:

    __() -> Option D
  4. Quick Check:

    Return translatable string = __() [OK]
Quick Trick: Use __() to get translated text without printing [OK]
Common Mistakes:
  • Confusing _e() with __()
  • Thinking load_theme_textdomain() translates strings
  • Using non-existent translate_text() function

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes