Translation_Entry::key
Generates a unique key for this entry.
Method of the class: Translation_Entry{}
No Hooks.
Returns
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() Translation Entry::key code WP 6.9.1
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;
}