Translation_Entry::key()publicWP 2.8.0

Generates a unique key for this entry.

Method of the class: Translation_Entry{}

No Hooks.

Return

String|false. The key or false if the entry is null.

Usage

$Translation_Entry = new Translation_Entry();
$Translation_Entry->key();

Changelog

Since 2.8.0 Introduced.

Translation_Entry::key() code WP 6.5.2

public function key() {
	if ( null === $this->singular ) {
		return false;
	}

	// Prepend context and EOT, like in MO files.
	$key = ! $this->context ? $this->singular : $this->context . "\4" . $this->singular;
	// Standardize on \n line endings.
	$key = str_replace( array( "\r\n", "\r" ), "\n", $key );

	return $key;
}