get_translations_for_domain( string $domain ): Translations|NOOP_Translations

In this article

Returns the Translations instance for a text domain.

Description

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

Parameters

$domainstringrequired
Text domain. Unique identifier for retrieving translated strings.

Return

Translations|NOOP_Translations A Translations instance.

Source

 * Determines whether there are translations for the text domain.
 *
 * @since 3.0.0
 *
 * @global MO[] $l10n An array of all currently loaded text domains.
 *
 * @param string $domain Text domain. Unique identifier for retrieving translated strings.
 * @return bool Whether there are translations.
 */
function is_textdomain_loaded( $domain ) {
	global $l10n;
	return isset( $l10n[ $domain ] ) && ! $l10n[ $domain ] instanceof NOOP_Translations;
}

/**

Changelog

VersionDescription
2.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.