返回介绍

_e()

发布于 2017-09-11 13:22:27 字数 16848 浏览 1165 评论 0 收藏 0

_e( string $text,  string $domain = 'default' )

Display translated text.


description


参数

$text

(string) (Required) Text to translate.

$domain

(string) (Optional) Text domain. Unique identifier for retrieving translated strings.

Default value: 'default'


源代码

File: wp-includes/l10n.php

function _e( $text, $domain = 'default' ) {
	echo translate( $text, $domain );
}

更新日志

Versiondescription
1.2.0Introduced.

相关函数

Uses

  • wp-includes/l10n.php: translate()

Used By

  • wp-includes/widgets/class-wp-widget-media-audio.php: WP_Widget_Media_Audio::render_control_template_scripts()
  • wp-includes/widgets/class-wp-widget-media-video.php: WP_Widget_Media_Video::render_control_template_scripts()
  • wp-includes/widgets/class-wp-widget-media-image.php: WP_Widget_Media_Image::render_control_template_scripts()
  • wp-admin/includes/dashboard.php: wp_print_community_events_markup()
  • wp-includes/class-wp-customize-nav-menus.php: WP_Customize_Nav_Menus::print_post_type_container()
  • wp-includes/class-wp-customize-nav-menus.php: WP_Customize_Nav_Menus::print_custom_links_available_menu_item()
  • wp-includes/customize/class-wp-customize-background-position-control.php: WP_Customize_Background_Position_Control::content_template()
  • wp-admin/includes/update.php: wp_print_admin_notice_templates()
  • wp-includes/embed.php: print_embed_sharing_dialog()
  • wp-admin/includes/class-wp-screen.php: WP_Screen::render_meta_boxes_preferences()
  • wp-admin/includes/class-wp-screen.php: WP_Screen::render_view_mode()
  • wp-includes/customize/class-wp-customize-nav-menu-auto-add-control.php: WP_Customize_Nav_Menu_Auto_Add_Control::content_template()
  • wp-includes/customize/class-wp-customize-new-menu-control.php: WP_Customize_New_Menu_Control::render_content()
  • wp-includes/customize/class-wp-customize-nav-menu-location-control.php: WP_Customize_Nav_Menu_Location_Control::render_content()
  • wp-includes/customize/class-wp-customize-nav-menu-control.php: WP_Customize_Nav_Menu_Control::content_template()
  • wp-includes/customize/class-wp-customize-nav-menu-item-control.php: WP_Customize_Nav_Menu_Item_Control::content_template()
  • wp-includes/class-wp-customize-panel.php: WP_Customize_Panel::render_template()
  • wp-includes/class-wp-customize-panel.php: WP_Customize_Panel::content_template()
  • wp-includes/customize/class-wp-customize-nav-menus-panel.php: WP_Customize_Nav_Menus_Panel::content_template()
  • wp-includes/class-wp-customize-nav-menus.php: WP_Customize_Nav_Menus::available_items_template()
  • wp-includes/class-wp-customize-section.php: WP_Customize_Section::render_template()
  • wp-admin/includes/class-wp-links-list-table.php: WP_Links_List_Table::column_visible()
  • wp-admin/includes/class-wp-ms-themes-list-table.php: WP_MS_Themes_List_Table::column_cb()
  • wp-admin/includes/class-wp-media-list-table.php: WP_Media_List_Table::column_parent()
  • wp-admin/includes/class-wp-media-list-table.php: WP_Media_List_Table::column_title()
  • wp-includes/customize/class-wp-customize-theme-control.php: WP_Customize_Theme_Control::content_template()
  • wp-includes/customize/class-wp-customize-themes-section.php: WP_Customize_Themes_Section::render()
  • wp-admin/includes/theme.php: customize_themes_print_templates()
  • wp-admin/includes/class-wp-press-this.php: WP_Press_This::html()
  • wp-admin/includes/class-wp-press-this.php: WP_Press_This::post_formats_html()
  • wp-admin/includes/class-wp-press-this.php: WP_Press_This::categories_html()
  • wp-admin/includes/class-wp-press-this.php: WP_Press_This::tags_html()
  • wp-admin/includes/revision.php: wp_print_revision_templates()
  • wp-admin/includes/class-wp-media-list-table.php: WP_Media_List_Table::views()
  • wp-signup.php: show_user_form()
  • wp-signup.php: signup_another_blog()
  • wp-signup.php: signup_user()
  • wp-signup.php: confirm_user_signup()
  • wp-signup.php: confirm_blog_signup()
  • wp-signup.php: show_blog_form()
  • wp-admin/includes/network.php: network_step1()
  • wp-admin/includes/network.php: network_step2()
  • wp-admin/install.php: display_header()
  • wp-admin/install.php: display_setup_form()
  • wp-admin/includes/user.php: use_ssl_preference()
  • wp-admin/includes/class-wp-ms-users-list-table.php: WP_MS_Users_List_Table::no_items()
  • wp-admin/includes/class-wp-screen.php: WP_Screen::render_screen_layout()
  • wp-admin/includes/class-wp-screen.php: WP_Screen::render_per_page_options()
  • wp-admin/includes/class-wp-screen.php: WP_Screen::render_screen_meta()
  • wp-admin/includes/class-wp-plugins-list-table.php: WP_Plugins_List_Table::no_items()
  • wp-admin/includes/class-wp-links-list-table.php: WP_Links_List_Table::no_items()
  • wp-admin/includes/theme-install.php: install_theme_search_form()
  • wp-admin/includes/theme-install.php: install_themes_dashboard()
  • wp-admin/includes/theme-install.php: install_themes_upload()
  • wp-admin/includes/class-wp-list-table.php: WP_List_Table::no_items()
  • wp-admin/includes/class-wp-list-table.php: WP_List_Table::months_dropdown()
  • wp-admin/includes/ms.php: choose_primary_blog()
  • wp-admin/includes/ms.php: upload_is_user_over_quota()
  • wp-admin/includes/ms.php: upload_space_setting()
  • wp-admin/includes/image-edit.php: wp_image_editor()
  • wp-admin/includes/class-wp-ms-themes-list-table.php: WP_MS_Themes_List_Table::no_items()
  • wp-admin/includes/misc.php: admin_color_scheme_picker()
  • wp-admin/includes/class-wp-theme-install-list-table.php: WP_Theme_Install_List_Table::install_theme_info()
  • wp-admin/includes/class-wp-theme-install-list-table.php: WP_Theme_Install_List_Table::no_items()
  • wp-admin/includes/class-wp-theme-install-list-table.php: WP_Theme_Install_List_Table::single_row()
  • wp-admin/includes/class-wp-theme-install-list-table.php: WP_Theme_Install_List_Table::theme_installer()
  • wp-admin/includes/dashboard.php: wp_welcome_panel()
  • wp-admin/includes/plugin-install.php: install_dashboard()
  • wp-admin/includes/plugin-install.php: install_search_form()
  • wp-admin/includes/plugin-install.php: install_plugins_upload()
  • wp-admin/includes/plugin-install.php: install_plugins_favorites_form()
  • wp-admin/includes/plugin-install.php: install_plugin_information()
  • wp-admin/includes/dashboard.php: wp_dashboard_quota()
  • wp-admin/includes/dashboard.php: wp_network_dashboard_right_now()
  • wp-admin/includes/dashboard.php: wp_dashboard_quick_press()
  • wp-admin/includes/user.php: default_password_nag()
  • wp-admin/includes/class-wp-plugin-install-list-table.php: WP_Plugin_Install_List_Table::display_rows()
  • wp-admin/includes/template.php: _local_storage_notice()
  • wp-admin/includes/template.php: find_posts_div()
  • wp-admin/includes/template.php: iframe_header()
  • wp-admin/includes/template.php: wp_comment_reply()
  • wp-admin/includes/template.php: wp_comment_trashnotice()
  • wp-admin/includes/template.php: list_meta()
  • wp-admin/includes/template.php: meta_form()
  • wp-admin/includes/template.php: touch_time()
  • wp-admin/includes/template.php: wp_import_upload_form()
  • wp-admin/includes/template.php: do_accordion_sections()
  • wp-admin/includes/class-wp-themes-list-table.php: WP_Themes_List_Table::no_items()
  • wp-admin/includes/class-wp-themes-list-table.php: WP_Themes_List_Table::display_rows()
  • wp-admin/includes/class-wp-ms-sites-list-table.php: WP_MS_Sites_List_Table::no_items()
  • wp-admin/includes/class-wp-users-list-table.php: WP_Users_List_Table::no_items()
  • wp-admin/includes/class-wp-users-list-table.php: WP_Users_List_Table::extra_tablenav()
  • wp-admin/includes/media.php: media_upload_type_form()
  • wp-admin/includes/media.php: media_upload_type_url_form()
  • wp-admin/includes/media.php: media_upload_gallery_form()
  • wp-admin/includes/media.php: media_upload_library_form()
  • wp-admin/includes/media.php: media_upload_html_bypass()
  • wp-admin/includes/media.php: edit_form_image_editor()
  • wp-admin/includes/media.php: attachment_submitbox_metadata()
  • wp-admin/includes/media.php: media_upload_form()
  • wp-admin/includes/media.php: wp_iframe()
  • wp-admin/includes/post.php: _admin_notice_post_locked()
  • wp-admin/includes/meta-boxes.php: post_trackback_meta_box()
  • wp-admin/includes/meta-boxes.php: post_comment_status_meta_box()
  • wp-admin/includes/meta-boxes.php: post_comment_meta_box()
  • wp-admin/includes/meta-boxes.php: post_slug_meta_box()
  • wp-admin/includes/meta-boxes.php: post_author_meta_box()
  • wp-admin/includes/meta-boxes.php: page_attributes_meta_box()
  • wp-admin/includes/meta-boxes.php: link_submit_meta_box()
  • wp-admin/includes/meta-boxes.php: link_categories_meta_box()
  • wp-admin/includes/meta-boxes.php: link_target_meta_box()
  • wp-admin/includes/meta-boxes.php: link_xfn_meta_box()
  • wp-admin/includes/meta-boxes.php: link_advanced_meta_box()
  • wp-admin/includes/meta-boxes.php: post_submit_meta_box()
  • wp-admin/includes/meta-boxes.php: post_format_meta_box()
  • wp-admin/includes/meta-boxes.php: post_categories_meta_box()
  • wp-admin/includes/meta-boxes.php: post_excerpt_meta_box()
  • wp-admin/includes/class-wp-media-list-table.php: WP_Media_List_Table::no_items()
  • wp-admin/includes/class-wp-comments-list-table.php: WP_Comments_List_Table::no_items()
  • wp-admin/includes/class-wp-comments-list-table.php: WP_Comments_List_Table::extra_tablenav()
  • wp-admin/includes/class-wp-comments-list-table.php: WP_Comments_List_Table::column_cb()
  • wp-admin/includes/class-wp-terms-list-table.php: WP_Terms_List_Table::inline_edit()
  • wp-admin/includes/class-walker-nav-menu-edit.php: Walker_Nav_Menu_Edit::start_el()
  • wp-admin/includes/nav-menu.php: wp_nav_menu_item_link_meta_box()
  • wp-admin/includes/nav-menu.php: wp_nav_menu_item_post_type_meta_box()
  • wp-admin/includes/nav-menu.php: wp_nav_menu_item_taxonomy_meta_box()
  • wp-admin/includes/file.php: request_filesystem_credentials()
  • wp-admin/includes/class-wp-posts-list-table.php: WP_Posts_List_Table::inline_edit()
  • wp-admin/includes/widgets.php: wp_widget_control()
  • wp-admin/custom-header.php: Custom_Image_Header::step_1()
  • wp-admin/custom-header.php: Custom_Image_Header::step_2()
  • wp-admin/custom-header.php: Custom_Image_Header::show_header_selector()
  • wp-admin/includes/ms.php: confirm_delete_users()
  • wp-admin/update-core.php: core_upgrade_preamble()
  • wp-admin/update-core.php: list_plugin_updates()
  • wp-admin/update-core.php: list_theme_updates()
  • wp-admin/update-core.php: list_translation_updates()
  • wp-admin/update-core.php: do_core_upgrade()
  • wp-admin/custom-background.php: Custom_Background::admin_page()
  • wp-includes/load.php: wp_maintenance()
  • wp-includes/functions.php: wp_auth_check_html()
  • wp-includes/functions.php: dead_db()
  • wp-includes/widgets/class-wp-nav-menu-widget.php: WP_Nav_Menu_Widget::form()
  • wp-includes/widgets/class-wp-widget-recent-comments.php: WP_Widget_Recent_Comments::form()
  • wp-includes/widgets/class-wp-widget-categories.php: WP_Widget_Categories::form()
  • wp-includes/widgets/class-wp-widget-recent-posts.php: WP_Widget_Recent_Posts::form()
  • wp-includes/widgets/class-wp-widget-calendar.php: WP_Widget_Calendar::form()
  • wp-includes/widgets/class-wp-widget-search.php: WP_Widget_Search::form()
  • wp-includes/widgets/class-wp-widget-archives.php: WP_Widget_Archives::form()
  • wp-includes/widgets/class-wp-widget-meta.php: WP_Widget_Meta::widget()
  • wp-includes/widgets/class-wp-widget-meta.php: WP_Widget_Meta::form()
  • wp-includes/widgets/class-wp-widget-pages.php: WP_Widget_Pages::form()
  • wp-includes/widgets/class-wp-widget-links.php: WP_Widget_Links::form()
  • wp-includes/widgets.php: wp_widget_rss_form()
  • wp-includes/class-wp-admin-bar.php: WP_Admin_Bar::_render()
  • wp-includes/rss.php: wp_rss()
  • wp-includes/customize/class-wp-customize-header-image-control.php: WP_Customize_Header_Image_Control::print_header_image_template()
  • wp-includes/customize/class-wp-customize-header-image-control.php: WP_Customize_Header_Image_Control::render_content()
  • wp-includes/customize/class-wp-widget-area-customize-control.php: WP_Widget_Area_Customize_Control::render_content()
  • wp-includes/class-wp-customize-control.php: WP_Customize_Control::render_content()
  • wp-includes/class-walker-comment.php: Walker_Comment::comment()
  • wp-includes/class-walker-comment.php: Walker_Comment::html5_comment()
  • wp-includes/class-walker-comment.php: Walker_Comment::ping()
  • wp-includes/comment-template.php: comments_popup_link()
  • wp-includes/class-wp-customize-widgets.php: WP_Customize_Widgets::output_widget_control_templates()
  • wp-includes/class-wp-editor.php: _WP_Editors::wp_link_dialog()
  • wp-includes/media-template.php: wp_print_media_templates()
  • Show 162 more used by Hide more used by

User Contributed Notes

  1. Skip to note content You must log in to vote on the helpfulness of this noteVote results for this note: 1You must log in to vote on the helpfulness of this note Contributed by Codex

    Basic Example

    Display some translated text:

    
    <?php _e( 'Some text to translate and display.', 'textdomain' ); ?>
    
  2. This function is same as echo __ like:

    
    
    // their are same
    echo __( 'translate text', 'textdomain' );
    
    _e( 'translate text', 'textdomain' );
    
    

    The WordPress documentation states that you should not use

    echo __( 'translate text', 'textdomain' );

    but use

    _e( 'translate text', 'textdomain' );

    instead.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文