Opened 12 years ago
Closed 12 years ago
#30946 closed defect (bug) (fixed)
wp_update_comment() can't update the comment_post_ID
| Reported by: | tyxla | Owned by: | pento |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.2 |
| Component: | Comments | Version: | 4.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
The current implementation of wp_update_comment() does not allow to change the comment_post_ID - the ID of the post that the comment is posted to. Even if comment_post_ID is passed to the array parameter, it is being stripped off the database update query.
So, the following code:
wp_update_comment(array( 'comment_ID' => 1, 'comment_post_ID' => 2, 'comment_content' => 'test text here', ));
will not change the comment_post_ID to 2, even if 2 is a valid post ID.
Attachments (2)
Change History (10)
@
12 years ago
Allowing the comment_post_ID to be updated, and if passed, make sure that it corresponds to a valid post ID. Adding a unit test assertion in Tests_Comment::test_wp_update_comment() for that functionality.
#5
@
12 years ago
Confirmed bug and tested submitted patch. Patch looks good. Added minor formatting adjustment.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #30307, #30627.