PO::export_to_file() public WP 1.0
Same as {@link export}, but writes the result to a file
{} Это метод класса: PO{}
Хуков нет.
Возвращает
true|false
. true on success, false on error
Использование
$PO = new PO(); $PO->export_to_file( $filename, $include_headers );
- $filename(строка) (обязательный)
- Where to write the PO string.
- $include_headers(true|false)
- Whether to include the headers in the export.
Код 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 );
}