-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathWP_Export_Returner.php
More file actions
26 lines (23 loc) · 1.04 KB
/
WP_Export_Returner.php
File metadata and controls
26 lines (23 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
class WP_Export_Returner extends WP_Export_Base_Writer {
private $result = '';
public function export() {
try {
parent::export();
} catch ( WP_Export_Exception $e ) {
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Possibly used by third party extension.
$message = apply_filters( 'export_error_message', $e->getMessage() );
return new WP_Error( 'wp-export-error', $message );
} catch ( WP_Export_Term_Exception $e ) {
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Possibly used by third party extensions.
do_action( 'export_term_orphaned', $this->formatter->export->missing_parents );
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Possibly used by third party extension.
$message = apply_filters( 'export_term_error_message', $e->getMessage() );
return new WP_Error( 'wp-export-error', $message );
}
return $this->result;
}
protected function write( $xml ) {
$this->result .= $xml;
}
}