WordPress Export WXR and Capture the Results

<?php require ABSPATH . 'wp-admin/includes/export.php'; // Buffer output ob_start(); // Generates the WXR export file for download. $defaults = array ( 'content' => 'all', 'author' => false, 'category' => false, 'start_date' => false, 'end_date' => false, 'status' => false, ); export_wp( $defaults ); // Get the buffer contents $xml_export_data = ob_get_clean(); echo $xml_export_data;

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.