W3cubDocs

/WordPress

WP_Textdomain_Registry::get_paths_for_domain( string $domain ): string[]

Returns possible language directory paths for a given text domain.

Parameters

$domainstringrequired
Text domain.

Return

string[] Array of language directory paths.

Source

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;
}

Changelog

Version Description
6.2.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_textdomain_registry/get_paths_for_domain