get_translations_for_domain

Advertisement

Summery Summery

Return the Translations instance for a text domain.

Syntax Syntax

get_translations_for_domain( string $domain )

Description Description

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

Parameters Parameters

$domain

(Required) Text domain. Unique identifier for retrieving translated strings.

Return Return

(Translations|NOOP_Translations) A Translations instance.

Source Source

File: wp-includes/l10n.php

	}

	if ( ! isset( $available_translations[ $domain ] ) ) {
		$available_translations[ $domain ] = _get_path_to_translation_from_lang_dir( $domain );
	}

	return $available_translations[ $domain ];
}

/**
 * Gets the path to a translation file in the languages directory for the current locale.
 *
 * Holds a cached list of available .mo files to improve performance.

Advertisement

Changelog Changelog

Changelog
Version Description
2.8.0 Introduced.

Advertisement

Leave a Reply