translate_with_context( string $text, string $domain ): string

This function has been deprecated since 3.0.0. Use _x() instead.

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

Description

See also

Parameters

$textstringrequired
Text to translate.
$domainstringrequired
Domain to retrieve the translated text.

Return

string Translated text.

Source

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

Changelog

VersionDescription
3.0.0Deprecated. Use _x()
2.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.