import_start() public method

Parses the WXR file and prepares us for the task of processing parsed data
public import_start ( string $file )
$file string Path to the WXR file for importing
 public function get_importable_attachments($file)
 {
     $load_importer = $this->load_content_importer();
     if (!$load_importer) {
         return false;
     }
     $wp_import = new WP_Import();
     // this parse the file info
     $wp_import->import_start($file);
     $attachments = array();
     foreach ($wp_import->posts as $post) {
         if ($post['post_type'] == 'attachment') {
             $attachments[] = $post;
         }
     }
     return $attachments;
 }
Example #2
0
 public function import_start($file)
 {
     $this->updateStats(__("Parsing import file", 'Pixelentity Theme/Plugin'));
     parent::import_start($file);
 }