Title: WP_Translation_File::headers
Published: April 3, 2024
Last modified: May 20, 2026

---

# WP_Translation_File::headers(): array<string,

## In this article

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

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

Returns all headers.

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

 array<string, string> Headers.

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

    ```php
    public function headers(): array {
    	if ( ! $this->parsed ) {
    		$this->parse_file();
    	}
    	return $this->headers;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n/class-wp-translation-file.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/l10n/class-wp-translation-file.php#L149)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/l10n/class-wp-translation-file.php#L149-L154)

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

| Uses | Description | 
| [WP_Translation_File::parse_file()](https://developer.wordpress.org/reference/classes/wp_translation_file/parse_file/)`wp-includes/l10n/class-wp-translation-file.php` |

Parses the file.

  |

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

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

## User Contributed Notes

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