WordPress.org

Make WordPress Core

Ticket #24212: 24212.2.diff

File 24212.2.diff, 1.6 KB (added by fjarrett, 5 years ago)
  • wp-includes/l10n.php

    diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php
    index 750e08d..e21def2 100644
    a b function _ex( $text, $context, $domain = 'default' ) { 
    205205        echo _x( $text, $context, $domain );
    206206}
    207207
    208 function esc_attr_x( $single, $context, $domain = 'default' ) {
    209         return esc_attr( translate_with_gettext_context( $single, $context, $domain ) );
     208/**
     209 * Displays translated string with gettext context and escapes it for safe use in an attribute.
     210 *
     211 * @see esc_attr
     212 * @since 2.8.0
     213 *
     214 * @param string $text Text to translate
     215 * @param string $context Context information for the translators
     216 * @param string $domain Optional. Domain to retrieve the translated text
     217 * @return string Translated text
     218 */
     219function esc_attr_x( $text, $context, $domain = 'default' ) {
     220        return esc_attr( translate_with_gettext_context( $text, $context, $domain ) );
    210221}
    211222
    212 function esc_html_x( $single, $context, $domain = 'default' ) {
    213         return esc_html( translate_with_gettext_context( $single, $context, $domain ) );
     223/**
     224 * Displays translated string with gettext context and escapes it for safe use in HTML output.
     225 *
     226 * @see esc_html
     227 * @since 2.9.0
     228 *
     229 * @param string $text Text to translate
     230 * @param string $context Context information for the translators
     231 * @param string $domain Optional. Domain to retrieve the translated text
     232 * @return string Translated text
     233 */
     234function esc_html_x( $text, $context, $domain = 'default' ) {
     235        return esc_html( translate_with_gettext_context( $text, $context, $domain ) );
    214236}
    215237
    216238/**