translate_with_context

函数


translate_with_context ( $text, $domain = 'default' )
参数
  • (string)
    $text
    Text to translate.
    Required:
  • (string)
    $domain
    Domain to retrieve the translated text.
    Required:
    Default: ‘default’
返回值
  • (string) Translated text.
相关
  • _x()
定义位置
  • wp-includes/deprecated.php
    , line 1788
引入
2.5.0
弃用
2.9.0

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

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