PO::export_to_file() public WP 1.0
Same as {@link export}, but writes the result to a file
{} It's a method of the class: PO{}
No Hooks.
Return
true|false
. true on success, false on error
Usage
$PO = new PO(); $PO->export_to_file( $filename, $include_headers );
- $filename(string) (required)
- Where to write the PO string.
- $include_headers(true|false)
- Whether to include the headers in the export.
Code of PO::export_to_file() PO::export to file WP 5.7
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 );
}