Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_get_pomo_file_data ›

Seit3.7.0
Veraltetn/v
wp_get_pomo_file_data ( $po_file )
Parameter:
  • (string) $po_file Path to PO file.
    Erforderlich: Ja
Gibt zurück:
  • (array) PO file headers.
Definiert in:
Codex:

Extract headers from a PO file.



Quellcode

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