wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_set_script_module_translations › WordPress Function

Seit7.0.0
Veraltetn/v
wp_set_script_module_translations ( $id, $domain = 'default', $path = '' )
Parameter: (3)
  • (string) $id The identifier of the script module.
    Erforderlich: Ja
  • (string) $domain Optional. Text domain. Default 'default'.
    Erforderlich: Nein
    Standard: 'default'
  • (string) $path Optional. The full file path to the directory containing translation files.
    Erforderlich: Nein
    Standard: (leer)
Siehe:
  • WP_Script_Modules::set_translations()
Gibt zurück:
  • (bool) True if the text domain was registered, false if the module is not registered.
Definiert in:
Codex:

Overrides the text domain and path used to load translations for a script module.

Translations for script modules are loaded automatically from the default text domain and language directory. Use this function only when a module's text domain differs from 'default' or when translation files live outside the standard location, for example plugin modules using their own text domain.


Quellcode

function wp_set_script_module_translations( string $id, string $domain = 'default', string $path = '' ): bool {
	return wp_script_modules()->set_translations( $id, $domain, $path );
}