W3cubDocs

/WordPress

translate_with_context( string $text, string $domain = 'default' )

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

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

Description

See also

Parameters

$text

(string) (Required) Text to translate.

$domain

(string) (Optional) Domain to retrieve the translated text.

Default value: 'default'

Return

(string) Translated text.

Source

File: wp-includes/deprecated.php

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

Changelog

Version Description
3.0.0 Use _x()
2.5.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/translate_with_context