_load_textdomain_just_in_time

Advertisement

Private Access Private Access

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness. Use get_translations_for_domain() instead.

Summery Summery

Loads plugin and theme textdomains just-in-time.

Syntax Syntax

_load_textdomain_just_in_time( string $domain )

Description Description

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().

Parameters Parameters

$domain

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

Return Return

(bool) True when the textdomain is successfully loaded, false otherwise.

Source Source

File: wp-includes/l10n.php

 * @since 5.0.2
 *
 * @param string|false $file   Path to the translation file to load. False if there isn't one.
 * @param string       $handle Name of the script to register a translation domain to.
 * @param string       $domain The text domain.
 * @return string|false The JSON-encoded translated strings for the given script handle and text domain. False if there are none.
 */
function load_script_translations( $file, $handle, $domain ) {
	/**
	 * Pre-filters script translations for the given file, script handle and text domain.
	 *
	 * Returning a non-null value allows to override the default logic, effectively short-circuiting the function.
	 *
	 * @since 5.0.2
	 *
	 * @param string|false|null $translations JSON-encoded translation data. Default null.
	 * @param string|false      $file         Path to the translation file to load. False if there isn't one.

Advertisement

Changelog Changelog

Changelog
Version Description
4.6.0 Introduced.

See also See also

Advertisement

Leave a Reply