Title: Translations::add_entry
Published: April 25, 2014
Last modified: May 20, 2026

---

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

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/translations/add_entry/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/translations/add_entry/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/translations/add_entry/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/translations/add_entry/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/translations/add_entry/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/translations/add_entry/?output_format=md#wp--skip-link--target)

Adds an entry to the PO structure.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/translations/add_entry/?output_format=md#parameters)󠁿

 `$entry`array|[Translation_Entry](https://developer.wordpress.org/reference/classes/translation_entry/)
required

## 󠀁[Return](https://developer.wordpress.org/reference/classes/translations/add_entry/?output_format=md#return)󠁿

 bool True on success, false if the entry doesn’t have a key.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/translations/add_entry/?output_format=md#source)󠁿

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

[View all references](https://developer.wordpress.org/reference/files/wp-includes/pomo/translations.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/pomo/translations.php#L48)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/pomo/translations.php#L48-L58)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/translations/add_entry/?output_format=md#related)󠁿

| Uses | Description | 
| [Translation_Entry::__construct()](https://developer.wordpress.org/reference/classes/translation_entry/__construct/)`wp-includes/pomo/entry.php` |  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/translations/add_entry/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Ftranslations%2Fadd_entry%2F)
before being able to contribute a note or feedback.