Summery Summery

Same as {@link export}, but writes the result to a file

Syntax Syntax

PO::export_to_file( string $filename, bool $include_headers = true )

Parameters Parameters


(string) (Required) where to write the PO string


(bool) (Optional) whether to include tje headers in the export

Default value: true

Return Return

(bool) true on success, false on error

Source Source

File: wp-includes/pomo/po.php

		function export_to_file( $filename, $include_headers = true ) {
			$fh = fopen( $filename, 'w' );
			if ( false === $fh ) {
				return false;
			$export = $this->export( $include_headers );
			$res    = fwrite( $fh, $export );
			if ( false === $res ) {
				return false;
			return fclose( $fh );



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.