• Since WP?2.7 we have new threaded comments functionality.

    Let us suppose that I have enabled threaded comments is WP and have made required modifications to my theme. Now visitors can reply to existing comments, making threaded comments.

    But old comments are still plain (not threaded), because all of them are stored in the database as replyes to the post, not as replyes to another replyes.

    I want to edit old comments (their comment_parent fields) to make them threaded too. But WordPress does not allow me to edit comment_parent! When I press “Edit comment” link, I can edit author name, author url, even the time of comment, but not the parent of this comment!!!

    I decided to fix this problem. I have edited the wp-admin/edit-form-comment.php and added after

    <td><input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr($url); ?>" tabindex="3" /></td>
    </tr>

    the following:

    <tr valign="top">
      <td class="first">
        Comment parent:
      </td>
      <td>
        <input type="text" id="newcomment_parent" name="newcomment_parent" size="30" class="code" value="<?php echo esc_attr($comment->comment_parent); ?>"/>
      </td>
    </tr>

    Then I edited wp-admin/includes/comment.php, I have added after the following line:
    $_POST['comment_ID'] = (int) $_POST['comment_ID'];
    this one:
    $_POST['comment_parent'] = (int) $_POST['newcomment_parent'];

    Finally, I edited wp-includes/comment.php, modified the following line:
    $data = compact('comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_parent', 'comment_date', 'comment_date_gmt');
    in the wp_update_comment function.

    Now I can see the value of comment_parent field in the comment editor, but this value does not update when I change it and press “Update comment” button.

    I am shure that I have missed something when edited WorpPress source.

    Dear WordPress users! Where I should modify WordPress to be able to edit comment_parent fields of comments?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Anyone ?

    It looks like your editing all the right php files. I’m not sure what the problem is for you, but I know that when I added stuff like you are to my theme I had to edit all the php files to make the options show up like you have, but I’m thinking you need to add something to your master.css file.

    The php’s are showing you stuff and are calling for things to take place.

    But without editing your master.css the things that php files are calling for are not there for them to grab.

    This is just my thought, I could be totally wrong.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Make existing comments threaded (Edit comment_parent field of comments)’ is closed to new replies.