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.

Contents


Return

(string|false) The key or false if the entry is empty.


Top ↑

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;
		}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.