WP_Textdomain_Registry::get_paths_for_domain()privateWP 6.2.0

Returns possible language directory paths for a given text domain.

Method of the class: WP_Textdomain_Registry{}

No Hooks.

Return

String[]. Array of language directory paths.

Usage

// private - for code of main (parent) class only
$result = $this->get_paths_for_domain( $domain );
$domain(string) (required)
Text domain.

Changelog

Since 6.2.0 Introduced.

WP_Textdomain_Registry::get_paths_for_domain() code WP 6.8

private function get_paths_for_domain( $domain ) {
	$locations = array(
		WP_LANG_DIR . '/plugins',
		WP_LANG_DIR . '/themes',
	);

	if ( isset( $this->custom_paths[ $domain ] ) ) {
		$locations[] = $this->custom_paths[ $domain ];
	}

	return $locations;
}