Make WordPress Core

Changeset 24825


Ignore:
Timestamp:
07/28/2013 09:26:10 PM (11 years ago)
Author:
nacin
Message:

Inline documentation for esc_attr_x() and esc_html_x(). props fjarrett, fixes #24212.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/l10n.php

    r22346 r24825  
    206206}
    207207
    208 function esc_attr_x( $single, $context, $domain = 'default' ) {
    209     return esc_attr( translate_with_gettext_context( $single, $context, $domain ) );
    210 }
    211 
    212 function esc_html_x( $single, $context, $domain = 'default' ) {
    213     return esc_html( 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 ) );
     221}
     222
     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
Note: See TracChangeset for help on using the changeset viewer.