WP_Translation_Controller::is_textdomain_loaded( string $textdomain = ‘default’, string $locale = null ): bool

In this article

Determines whether translations are loaded for a given text domain.

Parameters

$textdomainstringoptional
Text domain. Default 'default'.

Default:'default'

$localestringoptional
Locale. Default current locale.

Default:null

Return

bool True if there are any loaded translations, false otherwise.

Source

public function is_textdomain_loaded( string $textdomain = 'default', ?string $locale = null ): bool {
	if ( null === $locale ) {
		$locale = $this->current_locale;
	}

	return isset( $this->loaded_translations[ $locale ][ $textdomain ] ) &&
		array() !== $this->loaded_translations[ $locale ][ $textdomain ];
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

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