load_theme_textdomain

Definition:
function load_theme_textdomain( $domain, $path = false ) {}

Loads the theme’s translated strings.
If the current locale exists as a .mo file in the theme’s root directory, it will be included in the translated strings by the $domain.

Parameters

  • string $domain: Unique identifier for retrieving translated strings
  • $path

Defined filters

  • theme_locale
    apply_filters( 'theme_locale', get_locale()

Source code

function load_theme_textdomain( $domain, $path = false ) {

	$locale = apply_filters( 'theme_locale', get_locale(), $domain );



	$path = ( empty( $path ) ) ? get_template_directory() : $path;



	$mofile = "$path/$locale.mo";

	return load_textdomain($domain, $mofile);

}

2293

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: