WordPress at a glance
function is not described

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.


String. Translated text.


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


  • See: _x()


Since 2.5.0 Introduced.
Deprecated Since 3.0.0 Use _x()

Code of translate_with_context() WP 5.7

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