wp_get_pomo_file_data()WP 3.7.0

Extracts headers from a PO file.

Хуков нет.

Возвращает

Строку[]. Array of PO file header values keyed by header name.

Использование

wp_get_pomo_file_data( $po_file );
$po_file(строка) (обязательный)
Path to PO file.

Список изменений

С версии 3.7.0 Введена.

Код wp_get_pomo_file_data() WP 6.4.3

function wp_get_pomo_file_data( $po_file ) {
	$headers = get_file_data(
		$po_file,
		array(
			'POT-Creation-Date'  => '"POT-Creation-Date',
			'PO-Revision-Date'   => '"PO-Revision-Date',
			'Project-Id-Version' => '"Project-Id-Version',
			'X-Generator'        => '"X-Generator',
		)
	);
	foreach ( $headers as $header => $value ) {
		// Remove possible contextual '\n' and closing double quote.
		$headers[ $header ] = preg_replace( '~(\\\n)?"$~', '', $value );
	}
	return $headers;
}