You are here

public function WordPressItemSource::count in WordPress Migrate 7

Return a count of all available source records.

Parameters

boolean $refresh: Not currently in use.

Overrides WordPressSource::count

File

./wordpress_item.inc, line 67
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 count($refresh = FALSE) {
  $post_types = $this->xml
    ->xpath("//channel/item[wp:post_type='{$this->postType}']");
  $count = count($post_types);
  return $count;
}