translate_with_context()WP 2.5.0

Deprecated from version 3.0.0. It is no longer supported and can be removed in future releases. Use _x() instead.

Translates $text like translate(), but assumes that the text contains a context after its last vertical bar.

No Hooks.

Return

String. Translated text.

Usage

translate_with_context( $text, $domain );
$text(string) (required)
Text to translate.
$domain(string)
Domain to retrieve the translated text.
Default: 'default'

Notes

  • See: _x()

Changelog

Since 2.5.0 Introduced.
Deprecated since 3.0.0 Use _x()

translate_with_context() code WP 6.4.3

function translate_with_context( $text, $domain = 'default' ) {
	_deprecated_function( __FUNCTION__, '2.9.0', '_x()' );
	return before_last_bar( translate( $text, $domain ) );
}