Translations::add_entry( array|Translation_Entry $entry ): bool

In this article

Adds an entry to the PO structure.

Parameters

$entryarray|Translation_Entryrequired

Return

bool True on success, false if the entry doesn’t have a key.

Source

public function add_entry( $entry ) {
	if ( is_array( $entry ) ) {
		$entry = new Translation_Entry( $entry );
	}
	$key = $entry->key();
	if ( false === $key ) {
		return false;
	}
	$this->entries[ $key ] = &$entry;
	return true;
}

Changelog

VersionDescription
2.8.0Introduced.

User Contributed Notes

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