wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



load_script_module_textdomain › WordPress Function

Desde7.0.0
Obsoleton/a
› load_script_module_textdomain ( $id, $domain = 'default', $path = '' )
Parâmetros: (3)
  • (string) $id The script module identifier.
    Required: Yes
  • (string) $domain Optional. Text domain. Default 'default'.
    Required: No
    Padrão: 'default'
  • (string) $path Optional. The full file path to the directory containing translation files.
    Required: No
    Padrão: (empty)
Retorna:
  • (string|false) The JSON-encoded translated strings for the given script module and text domain.
    False if there are none.
Definido em:
Codex:


Fonte

function load_script_module_textdomain( string $id, string $domain = 'default', string $path = '' ) {
	$module = wp_script_modules()->get_registered( $id );
	if ( null === $module ) {
		return false;
	}
	$src = $module['src'];

	// Ensure src is an absolute URL for path resolution.
	if ( ! preg_match( '|^(https?:)?//|', $src ) ) {
		$src = site_url( $src );
	}

	return _load_script_textdomain_from_src( $id, $src, $domain, $path, true );
}