Translation_Entry::key() WordPress Method
The Translation_Entry::key() method is used to retrieve the translation key for a given word or phrase. This can be useful when trying to debug your code or when you need to lookup the translation for a specific word or phrase.
Translation_Entry::key() #
Generates a unique key for this entry.
Return
(string|false) The key or false if the entry is empty.
Source
File: wp-includes/pomo/entry.php
public function key() {
if ( null === $this->singular || '' === $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;
}
Expand full source codeCollapse full source codeView on TracView on GitHub