WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Whats the function _e('xxx') (6 posts)

  1. Murry
    Member
    Posted 8 years ago #

    Hi folks - Ive been trying to find info on the php _e function.
    as inusage <h2><?php _e('Archives'); ?></h2>
    I understand that it "echos" Archives (i think) but cant find info in the codex other than being mentioned and Im not gamne to dig in the wp files.
    How is it used - briefly - Like its in the sidebar between the <H> tags - anybody explain please any attributes/parameters etc.
    Thanks

  2. Mark (podz)
    Support Maven
    Posted 8 years ago #

    I believe it's integral to the Localisation of the code.

  3. jalenack
    Member
    Posted 8 years ago #

    Yes, as I understand it works like this:

    If your blog is non-english (you've specified it in the wp-config file), then it will check the words within _e() and see if they have translations available in the language file. _e() is for echoing, and __() is for returning. This all makes it really easy to localize wordpress so that other language users can just plug and play.

    So anyways, if your blog is in English and it's going to stay in English (and you aren't going to release a theme or something), then it wouldn't make a lot of sense to use it.

  4. Heatsink
    Member
    Posted 8 years ago #

    In which file is the _e() function contained?

  5. skippy
    Member
    Posted 8 years ago #

    wp-includes/wp-l10n.php

  6. Heatsink
    Member
    Posted 8 years ago #

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags