You are here

public function WordPressComment::prepareRow in WordPress Migrate 7.2

Same name and namespace in other branches
  1. 7 wordpress_comment.inc \WordPressComment::prepareRow()

Implements Migration::prepareRow().

Parameters

$row:

Return value

bool

Overrides Migration::prepareRow

File

./wordpress_comment.inc, line 228
Support for migrating comments from a WordPress blog into Drupal.

Class

WordPressComment
Implementation of WordPressMigration, for comments

Code

public function prepareRow($row) {
  if (parent::prepareRow($row) === FALSE) {
    return FALSE;
  }

  // Reject spam
  if ($this
    ->xpathValue($row->xml
    ->xpath('wp:comment_approved')) == 'spam') {
    return FALSE;
  }

  // Ignore pingbacks if requested.
  if ($this
    ->xpathValue($row->xml
    ->xpath('wp:comment_type')) == 'pingback' && $this->arguments['skip_pingbacks']) {
    return FALSE;
  }
  return TRUE;
}