get_translations_for_domain()
最后更新于:2021-11-27 03:09:14
get_translations_for_domain( string$domain)响应 the Translations instance for a text domain.
参数
- $domain
-
(string) (Required) Text domain. Unique identifier for retrieving translated strings.
响应
(Translations|NOOP_Translations) A Translations instance.
源文件
文件: gc-includes/l10n.php
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;
}