Translations::add_entry() WordPress Method

The Translations::add_entry() method inserts a new translation into the WordPress database. The method takes three arguments: the original string, the translated string, and the domain. The original string and the translated string can be either a single string or an array of strings. The domain is the text domain for the translation.

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

Add entry to the PO structure


Parameters

$entry

(array|Translation_Entry)(Required)


Top ↑

Return

(bool) true on success, false if the entry doesn't have a key


Top ↑

Source

File: wp-includes/pomo/translations.php

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

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.