WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/ nx noop

Description

Register plural strings with context in POT file, but don't translate them.

Usage

<?php _nx_noop$singular$plural$context$domain ?>

Parameters

$singular
(string) (required) Singular form to be i18ned
Default: None
$plural
(string) (required) Plural form to be i18ned
Default: None
$context
(string) (required) Context information for the translators
Default: None
$domain
(string) (optional) The domain identifier the text will be retrieved in
Default: null

Return Values

(array) 
Returns an array containing six items - singular value, plural value and context.
array(
    0          =>  $singular,
    1          =>  $plural,
    3          =>  $context
    'singular' =>  $singular,
    'plural'   =>  $plural,
    'context'  =>  $context,
    'domain'   =>  $domain
)

Examples

$labels = array(
	'draft' => array( _nx_noop('%s Draft', '%s Drafts', 'post'), _nx_noop('%s Draft', '%s Drafts', 'page') ),
	'publish' => array( _nx_noop('%s Published', '%s Published', 'post'), _nx_noop('%s Published', '%s Published', 'page') )
);
if( $post_type == 'page' ) {
	$labels = $labels[$post_status][1];
} else {
	$labels = $labels[$post_status][0];
}
$usable_text = sprintf( translate_nooped_plural( $labels, $count, $domain ), $count );

Notes

Change Log

Source File

_nx_noop() is located in /wp-includes/l10n.php.

Related

L10n: translate(), __(), _e(), _n(), _x(), _ex(), _nx(), esc_attr__(), esc_attr_e(), esc_attr_x(), esc_html__(), esc_html_e(), esc_html_x(), _n_noop(), _nx_noop(), translate_nooped_plural()

See also index of Function Reference and index of Template Tags.