wp_get_pomo_file_data( string $po_file ): string[]

In this article

Extracts headers from a PO file.

Parameters

$po_filestringrequired
Path to PO file.

Return

string[] Array of PO file header values keyed by header name.

Source

/**
 * Extracts headers from a PHP translation file.
 *
 * @since 6.6.0
 *
 * @param string $php_file Path to a `.l10n.php` file.
 * @return string[] Array of file header values keyed by header name.
 */
function wp_get_l10n_php_file_data( $php_file ) {
	$data = (array) include $php_file;

	unset( $data['messages'] );
	$headers = array(
		'POT-Creation-Date'  => 'pot-creation-date',
		'PO-Revision-Date'   => 'po-revision-date',
		'Project-Id-Version' => 'project-id-version',

Changelog

VersionDescription
3.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.