On this page
esc_html__( string $text, string $domain = 'default' ): string
Retrieves the translation of $text and escapes it for safe use in HTML output.
Description
If there is no translation, or the text domain isn’t loaded, the original text is escaped and returned.
Parameters
$textstring Required-
Text to translate.
$domainstring Optional-
Text domain. Unique identifier for retrieving translated strings.
Default'default'.Default:
'default'
Return
string Translated text.
Source
File: wp-includes/l10n.php. View all references
function esc_html__( $text, $domain = 'default' ) {
return esc_html( translate( $text, $domain ) );
}
Related
Uses
| Uses | Description |
|---|---|
| translate() wp-includes/l10n.php | Retrieves the translation of $text. |
| esc_html() wp-includes/formatting.php | Escaping for HTML blocks. |
Used By
| Used By | Description |
|---|---|
| get_the_block_template_html() wp-includes/block-template.php | Returns the markup for the current template. |
| WP_Application_Passwords_List_Table::print_js_template_row() wp-admin/includes/class-wp-application-passwords-list-table.php | Prints the JavaScript template for the new row item. |
| Plugin_Installer_Skin::do_overwrite() wp-admin/includes/class-plugin-installer-skin.php | Check if the plugin can be overwritten and output the HTML for overwriting a plugin on upload. |
| Theme_Installer_Skin::do_overwrite() wp-admin/includes/class-theme-installer-skin.php | Check if the theme can be overwritten and output the HTML for overwriting a theme on upload. |
| WP_Privacy_Data_Removal_Requests_List_Table::column_next_steps() wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php | Next steps column. |
| WP_Privacy_Data_Export_Requests_List_Table::column_next_steps() wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php | Displays the next steps column. |
| wp_privacy_generate_personal_data_export_group_html() wp-admin/includes/privacy-tools.php | Generate a single group for the personal data export report. |
| wp_privacy_generate_personal_data_export_file() wp-admin/includes/privacy-tools.php | Generate the personal data export file. |
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/esc_html__