On this page
PO::export_to_file( string $filename, bool $include_headers = true ): bool
Same as {@link export}, but writes the result to a file
Parameters
$filenamestring Required-
Where to write the PO string.
$include_headersbool Optional-
Whether to include the headers in the export.
Default:
true
Return
bool true on success, false on error
Source
File: wp-includes/pomo/po.php. View all references
public 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 );
}
Related
Uses
| Uses | Description |
|---|---|
| PO::export() wp-includes/pomo/po.php | Exports the whole PO file as a string |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/po/export_to_file