_nx

Translates and retrieves the singular or plural form based on the supplied number, with gettext context.

Description

_nx( $single, $plural, (number) $number, $context, (string) $domain = 'default' ); 

Parameters (5)

0. $single
The single.
1. $plural
The plural.
2. $number (number)
The number.
3. $context
The context.
4. $domain — Optional. (string) => 'default'
The domain.

Usage

  1. if ( !function_exists( '_nx' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-l10n.php'; 
  3.  
  4. // The single. 
  5. $single = null; 
  6.  
  7. // The plural. 
  8. $plural = null; 
  9.  
  10. // The number. 
  11. $number = null; 
  12.  
  13. // The context. 
  14. $context = null; 
  15.  
  16. // The domain. 
  17. $domain = 'default'; 
  18.  
  19. // NOTICE! Understand what this does before running. 
  20. $result = _nx($single, $plural, $number, $context, $domain); 
  21.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bbpress/bb-includes/functions.bb-l10n.php  
  1. function _nx($single, $plural, $number, $context, $domain = 'default') { 
  2. $translations = &get_translations_for_domain( $domain ); 
  3. $translation = $translations->translate_plural( $single, $plural, $number, $context ); 
  4. return apply_filters( 'ngettext_with_context ', $translation, $single, $plural, $number, $context );