A WordPress-centric search engine for devs and theme authors



translate_with_context ›

Since2.5.0
Deprecated2.9.0
translate_with_context ( $text, $domain = 'default' )
Parameters: (2)
  • (string) $text Text to translate
    Required: Yes
  • (string) $domain Domain to retrieve the translated text
    Required: No
    Default: 'default'
See:
Returns:
  • (string) Translated text
Defined at:
Codex:

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



Source

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