[wp-trac] [WordPress Trac] #33154: Issues with Editing Comments where the post ID is zero or post is deleted
WordPress Trac
noreply at wordpress.org
Wed Aug 12 23:07:40 UTC 2015
#33154: Issues with Editing Comments where the post ID is zero or post is deleted
-----------------------------+-----------------------------
Reporter: johnnietb | Owner: pento
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.2.5
Component: Role/Capability | Version: 4.2.3
Severity: normal | Resolution:
Keywords: has-patch | Focuses: administration
-----------------------------+-----------------------------
Comment (by dd32):
Replying to [comment:16 ocean90]:
> With [attachment:33154.3.diff] the response column is empty for existing
posts too. `$post = get_post( $comment->comment_post_ID );` in
`WP_Comments_List_Table::single_row()` sets the global `$post` variable so
that `get_post()` in `WP_Comments_List_Table::column_response()` returns
the correct post object.
>
> [attachment:33154.4.diff] fixes this issue by using `get_post(
$comment->comment_post_ID )` in
`WP_Comments_List_Table::column_response()`.
Reliance on Globals, Ugh. Good catch, updated patch gets a +1 from me.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33154#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list