From f19377fb81d57c1f3dfe3e9fd853186a9b13cb8b Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 28 Jul 2013 21:26:10 +0000 Subject: [PATCH] Inline documentation for esc_attr_x() and esc_html_x(). props fjarrett, fixes #24212. git-svn-id: http://core.svn.wordpress.org/trunk@24825 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/l10n.php | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 750e08dec4..4df86ba60a 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -205,12 +205,34 @@ function _ex( $text, $context, $domain = 'default' ) { echo _x( $text, $context, $domain ); } -function esc_attr_x( $single, $context, $domain = 'default' ) { - return esc_attr( translate_with_gettext_context( $single, $context, $domain ) ); +/** + * Displays translated string with gettext context and escapes it for safe use in an attribute. + * + * @see esc_attr() + * @since 2.8.0 + * + * @param string $text Text to translate + * @param string $context Context information for the translators + * @param string $domain Optional. Domain to retrieve the translated text + * @return string Translated text + */ +function esc_attr_x( $text, $context, $domain = 'default' ) { + return esc_attr( translate_with_gettext_context( $text, $context, $domain ) ); } -function esc_html_x( $single, $context, $domain = 'default' ) { - return esc_html( translate_with_gettext_context( $single, $context, $domain ) ); +/** + * Displays translated string with gettext context and escapes it for safe use in HTML output. + * + * @see esc_html() + * @since 2.9.0 + * + * @param string $text Text to translate + * @param string $context Context information for the translators + * @param string $domain Optional. Domain to retrieve the translated text + * @return string Translated text + */ +function esc_html_x( $text, $context, $domain = 'default' ) { + return esc_html( translate_with_gettext_context( $text, $context, $domain ) ); } /**