Un motore di ricerca WordPress per sviluppatori e autori di temi



_load_textdomain_just_in_time ›

Da4.6.0
Deprecaton/a
_load_textdomain_just_in_time ( $domain )
Accedi:
  • private
Parametri:
  • (string) $domain Text domain. Unique identifier for retrieving translated strings.
    Richiesto:
Vedi:
Ritorna:
  • (bool) True when the textdomain is successfully loaded, false otherwise.
Definito a:
Codex:

Loads plugin and theme textdomains just-in-time.

When a textdomain is encountered for the first time, we try to load the translation file from wp-content/languages, removing the need to call load_plugin_texdomain() or load_theme_texdomain().



Sorgenti

function _load_textdomain_just_in_time( $domain ) {
	global $l10n_unloaded;

	$l10n_unloaded = (array) $l10n_unloaded;

	// Short-circuit if domain is 'default' which is reserved for core.
	if ( 'default' === $domain || isset( $l10n_unloaded[ $domain ] ) ) {
		return false;
	}

	$translation_path = _get_path_to_translation( $domain );
	if ( false === $translation_path ) {
		return false;
	}

	return load_textdomain( $domain, $translation_path );
}