Skip to:
Content
Pages
Categories
Search
Top
Bottom

why must there be _e() everywhere? (a newbie writes)

  • I have searched high and low for a clear explanation of this, but I can’t find one so I assume it’s so simple that nobody needs it explained.

    Except me.

    Why is my theme full of code like this

    I thought _e() was a translation function. What is going on here?

    Please excuse my ignorance,

    Duncan

Viewing 3 replies - 1 through 3 (of 3 total)

  • Boone Gorges
    Keymaster

    @boonebgorges

    It is a translation function. Wrapping ‘Blog Posts Feed’ in _e() ensures that it appears in the .po file that translators use to create language packs. The ‘buddypress’ argument ensures that it is associated with the ‘buddypress’ textdomain (since potentially the same string might be translated in different ways when part of different software packages).

    The difference between __() and _e() is that _e() echoes the string to the screen.


    pcwriter
    Participant

    @pcwriter

    @boonebgorges

    Thanks for that.
    And here I was thinking it was just ‘shorthand’ for echo() :-(

    @Boone

    Thanks very much!

    Your advice led me here:

    https://codex.wordpress.org/I18n_for_WordPress_Developers

    which helped clear up the finer points. And what that mysterious thing I kept ignorning, ‘I18n’, means… ;-)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘why must there be _e() everywhere? (a newbie writes)’ is closed to new replies.
Skip to toolbar