Warning: This function has been deprecated. Use _nx() instead.

_nc() WordPress Function

The nc function is used to create a new content type in WordPress. It allows you to easily create and manage custom post types, taxonomies, and fields.

_nc( string $single, string $plural, int $number, string $domain = 'default' ) #

Legacy version of _n(), which supports contexts.


Description

Strips everything from the translation after the last bar.

Top ↑

See also


Top ↑

Parameters

$single

(string)(Required)The text to be used if the number is singular.

$plural

(string)(Required)The text to be used if the number is plural.

$number

(int)(Required)The number to compare against to use either the singular or plural form.

$domain

(string)(Optional) Text domain. Unique identifier for retrieving translated strings.

Default value: 'default'


Top ↑

Return

(string) The translated singular or plural form.


Top ↑

Source

File: wp-includes/deprecated.php

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


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Use _nx()
2.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.