is_textdomain_loaded

The timeline below displays how wordpress function is_textdomain_loaded has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * 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;
}

WordPress Version: 6.1

/**
 * 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]);
}

WordPress Version: 5.1

/**
 * Whether there are translations for the text domain.
 *
 * @since 3.0.0
 *
 * @global MO[] $l10n
 *
 * @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]);
}

WordPress Version: 4.3

/**
 * Whether there are translations for the text domain.
 *
 * @since 3.0.0
 *
 * @global array $l10n
 *
 * @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]);
}

WordPress Version: 4.0

/**
 * Whether there are translations for the text domain.
 *
 * @since 3.0.0
 *
 * @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]);
}

WordPress Version: 3.7

/**
 * Whether there are translations for the text domain.
 *
 * @since 3.0.0
 * @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]);
}