get_translations_for_domain() – Return the Translations instance for a text domain.

You appear to be a bot. Output may be restricted

Description

Return the Translations instance for a text domain.

If there isn't one, returns empty Translations instance.

Usage

$Translations|NOOP_Translations = get_translations_for_domain( $domain );

Parameters

$domain
( string ) required – Text domain. Unique identifier for retrieving translated strings.

Returns

Translations|NOOP_Translations A Translations instance.

Source

File name: wordpress/wp-includes/l10n.php
Lines:

1 to 13 of 13
function get_translations_for_domain( $domain ) {
  global $l10n;
  if ( isset( $l10n[ $domain ] ) || ( _load_textdomain_just_in_time( $domain ) && isset( $l10n[ $domain ] ) ) ) {
    return $l10n[ $domain ];
  }

  static $noop_translations = null;
  if ( null === $noop_translations ) {
    $noop_translations = new NOOP_Translations;
  }

  return $noop_translations;
}
 

 View on GitHub View on Trac