WordPress at Your Fingertips
function is not described

_WP_Dependency::set_translations() public WP 5.0.0

Sets the translation domain for this dependency.

{} It's a method of the class: _WP_Dependency{}

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.


true|false. False if $domain is not a string, true otherwise.


$_WP_Dependency = new _WP_Dependency();
$_WP_Dependency->set_translations( $domain, $path );
$domain(string) (required)
The translation textdomain.
The full file path to the directory containing translation files.
Default: null

Code of _WP_Dependency::set_translations() WP 5.8.3

public function set_translations( $domain, $path = null ) {
	if ( ! is_string( $domain ) ) {
		return false;
	$this->textdomain        = $domain;
	$this->translations_path = $path;
	return true;