_nc

函数


_nc ( $single, $plural, $number, $domain = 'default' )
参数
  • (string)
    $single
    The text to be used if the number is singular.
    Required:
  • (string)
    $plural
    The text to be used if the number is plural.
    Required:
  • (int)
    $number
    The number to compare against to use either the singular or plural form.
    Required:
  • (string)
    $domain
    Optional. Text domain. Unique identifier for retrieving translated strings. Default ‘default’.
    Required:
    Default: ‘default’
返回值
  • (string) The translated singular or plural form.
相关
  • _nx()
定义位置
  • wp-includes/deprecated.php
    , line 1809
引入
2.7.0
弃用
2.9.0

_n()的遗留版本,它支持上下文。

从翻译中删除最后一个小节后的所有内容。

function _nc( $single, $plural, $number, $domain = 'default' ) {
	_deprecated_function( __FUNCTION__, '2.9.0', '_nx()' );
	return before_last_bar( _n( $single, $plural, $number, $domain ) );
}