WP_Textdomain_Registry::set_custom_path( string $domain, string $path )

In this article

Sets the custom path to the plugin’s/theme’s languages directory.

Description

Used by load_plugin_textdomain() and load_theme_textdomain().

Parameters

$domainstringrequired
Text domain.
$pathstringrequired
Language directory path.

Source

public function set_custom_path( $domain, $path ) {
	// If just-in-time loading was triggered before, reset the entry so it can be tried again.

	if ( isset( $this->all[ $domain ] ) ) {
		$this->all[ $domain ] = array_filter( $this->all[ $domain ] );
	}

	if ( empty( $this->current[ $domain ] ) ) {
		unset( $this->current[ $domain ] );
	}

	$this->custom_paths[ $domain ] = rtrim( $path, '/' );
}

Changelog

VersionDescription
6.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.