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

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


Description Description


Parameters Parameters

$filename

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

$include_headers

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

Default value: true


Top ↑

Return Return

(bool) true on success, false on error


Top ↑

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


Top ↑

User Contributed Notes User Contributed Notes

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