WP_Translation_File::import()protectedWP 6.5.0

Imports translations from another file.

Method of the class: WP_Translation_File{}

No Hooks.

Return

true|false. True on success, false otherwise.

Usage

// protected - for code of main (parent) or child class
$result = $this->import( $source ): bool;
$source(WP_Translation_File) (required)
Source file.

Changelog

Since 6.5.0 Introduced.

WP_Translation_File::import() code WP 6.7.1

protected function import( WP_Translation_File $source ): bool {
	if ( null !== $source->error() ) {
		return false;
	}

	$this->headers = $source->headers();
	$this->entries = $source->entries();
	$this->error   = $source->error();

	return null === $this->error;
}