WordPress.org

Forums

TypePad importer turns pings into comments (2 posts)

  1. dbarnhart
    Member
    Posted 4 years ago #

    Movable Type and Typepad Importer version 0.4 (the most recent) is turning Typepad PIngs into comments. When I look at the export file from Typepad, it clearly denotes it as a ping:

    PING:
    TITLE:
    URL: ht
    IP: 10.0.20.9
    BLOG NAME:
    DATE:
    (body of trackback/ping here)

    However when the importer is finished, it has turned it into a WordPress Comment and not a Ping.

  2. dbarnhart
    Member
    Posted 4 years ago #

    After some spelunking in movabletype-importer.php I was able to solve the problem.

    Sure enough, when saving the trackback the importer fails to to tell wp_insert_comment that it is a tackback and not a normal comment.

    Old (at line 309):

    $ping['comment_post_ID'] = $post_id;
    $ping = wp_filter_comment($ping);

    Changed to:

    $ping['comment_post_ID'] = $post_id;
    $ping['comment_type'] = 'trackback';
    $ping = wp_filter_comment($ping);

    In addition, Typepad appends "[Read More...]" to the end of the body, making clicking thru to the original blog more intuitive. TO mimic this behavior I changed line 308:

    Old:

    $ping['comment_content'] = "<strong>{$ping['title']}</strong>\n\n{$ping['comment_content']} ";

    Changed to:

    $ping['comment_content'] = "<strong>{$ping['title']}</strong>\n\n{$ping['comment_content']} <a href='" . $ping['comment_author_url'] ."'>[Read More...]</a>";

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags