diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 7a106100fe..0b546ebff4 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -1786,4 +1786,28 @@ function make_url_footnote( $content ) { return $content; } +/** + * Retrieve translated string with vertical bar context + * + * Quite a few times, there will be collisions with similar translatable text + * found in more than two places but with different translated context. + * + * In order to use the separate contexts, the _c() function is used and the + * translatable string uses a pipe ('|') which has the context the string is in. + * + * When the translated string is returned, it is everything before the pipe, not + * including the pipe character. If there is no pipe in the translated text then + * everything is returned. + * + * @since 2.2.0 + * @deprecated 2.9.0 + * + * @param string $text Text to translate + * @param string $domain Optional. Domain to retrieve the translated text + * @return string Translated context string without pipe + */ +function _c( $text, $domain = 'default' ) { + _deprecated_function(__FUNCTION__, '2.9', '_x' ); + return translate_with_context( $text, $domain ); +} ?> \ No newline at end of file diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 793e1980a1..e138c80163 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -176,27 +176,21 @@ function esc_html_e( $text, $domain = 'default' ) { } /** - * Retrieve translated string with vertical bar context + * Retrieve translated string with gettext context * * Quite a few times, there will be collisions with similar translatable text * found in more than two places but with different translated context. * - * In order to use the separate contexts, the _c() function is used and the - * translatable string uses a pipe ('|') which has the context the string is in. + * By including the context in the pot file translators can translate the two + * string differently * - * When the translated string is returned, it is everything before the pipe, not - * including the pipe character. If there is no pipe in the translated text then - * everything is returned. - * - * @since 2.2.0 + * @since 2.8 * * @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 context string without pipe */ -function _c( $text, $domain = 'default' ) { - return translate_with_context( $text, $domain ); -} function _x( $single, $context, $domain = 'default' ) { return translate_with_gettext_context( $single, $context, $domain );