You are here

public function WordPressItemSource::__construct in WordPress Migrate 7.2

Same name and namespace in other branches
  1. 7 wordpress_item.inc \WordPressItemSource::__construct()

Simple initialization.

Overrides MigrateSourceXML::__construct

1 call to WordPressItemSource::__construct()
WordPressAttachmentSource::__construct in ./wordpress_attachment.inc
Simple initialization.
1 method overrides WordPressItemSource::__construct()
WordPressAttachmentSource::__construct in ./wordpress_attachment.inc
Simple initialization.

File

./wordpress_item.inc, line 31
Support for migrating posts and pages from a WordPress blog into Drupal.

Class

WordPressItemSource
Implementation of MigrateSource, to handle migrating items from WordPress XML dumps.

Code

public function __construct($filename, $post_type, $cache_key, $namespaces = array()) {
  $source_options = array(
    'reader_class' => 'MigrateXMLReader',
    'cache_counts' => TRUE,
    'cache_key' => $cache_key,
  );
  $this->fields = $this
    ->fields();
  parent::__construct($filename, '/rss/channel/item', 'wp:post_id', $this->fields, $source_options, $namespaces);
  $this->postType = $post_type;
}