PO::export_headers() WordPress Method

The PO::export_headers() method allows you to export the headers of a PO file as an array.

PO::export_headers() #

Exports headers to a PO entry


Return

(string) msgid/msgstr PO entry for this PO file headers, doesn't contain newline at the end


Top ↑

Source

File: wp-includes/pomo/po.php

		public function export_headers() {
			$header_string = '';
			foreach ( $this->headers as $header => $value ) {
				$header_string .= "$header: $value\n";
			}
			$poified = PO::poify( $header_string );
			if ( $this->comments_before_headers ) {
				$before_headers = $this->prepend_each_line( rtrim( $this->comments_before_headers ) . "\n", '# ' );
			} else {
				$before_headers = '';
			}
			return rtrim( "{$before_headers}msgid \"\"\nmsgstr $poified" );
		}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.