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
This commit is contained in:
Andrew Nacin 2013-07-28 21:26:10 +00:00
parent c1d022dc12
commit f19377fb81
1 changed files with 26 additions and 4 deletions

View File

@ -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 ) );
}
/**