esc_attr__() - WordPress 函数参考中文文档

返回介绍

esc_attr__()

发布于 2017-09-10 字数3478 浏览 961 评论 0

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

Retrieve the translation of $text and escapes it for safe use in an attribute.


描述

If there is no translation, or the text domain isn’t loaded, the original text is returned.


参数

$text

(string)
(Required)
Text to translate.

$domain

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

Default value: ‘default’


返回值

(string) Translated text on success, original text on failure.


源代码

File: wp-includes/l10n.php

function esc_attr__( $text, $domain = 'default' ) {
	return esc_attr( translate( $text, $domain ) );
}

更新日志

Version 描述
2.8.0 Introduced.

相关函数

Uses

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

Used By

  • wp-includes/class-wp-customize-nav-menus.php:
    WP_Customize_Nav_Menus::enqueue_scripts()
  • wp-admin/includes/class-wp-comments-list-table.php:
    WP_Comments_List_Table::handle_row_actions()
  • wp-admin/includes/class-wp-screen.php:
    WP_Screen::render_screen_options()
  • wp-admin/includes/class-plugin-upgrader-skin.php:
    Plugin_Upgrader_Skin::after()
  • 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::single_row()
  • wp-admin/includes/update.php:
    update_nag()
  • wp-admin/includes/dashboard.php:
    wp_dashboard_browser_nag()
  • wp-admin/includes/dashboard.php:
    _wp_dashboard_recent_comments_row()
  • wp-admin/includes/media.php:
    wp_media_insert_url_form()
  • wp-admin/includes/media.php:
    edit_form_image_editor()
  • wp-admin/includes/media.php:
    get_media_item()
  • wp-admin/includes/class-wp-media-list-table.php:
    WP_Media_List_Table::get_columns()
  • wp-admin/includes/class-wp-comments-list-table.php:
    WP_Comments_List_Table::extra_tablenav()
  • 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/class-wp-posts-list-table.php:
    WP_Posts_List_Table::get_columns()
  • wp-admin/menu-header.php:
    _wp_menu_output()
  • wp-includes/functions.php:
    wp_timezone_choice()
  • wp-includes/widgets/class-wp-widget-meta.php:
    WP_Widget_Meta::widget()
  • wp-includes/class-wp-customize-widgets.php:
    WP_Customize_Widgets::enqueue_scripts()
  • wp-includes/script-loader.php:
    wp_default_scripts()
  • Show 17 more used by
    Hide more used by


User Contributed Notes

上一篇:esc_attr_x()

下一篇:esc_html()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!