[wp-trac] [WordPress Trac] #41228: No way to get the post ID after a comment is deleted

WordPress Trac noreply at wordpress.org
Mon Jul 3 10:56:08 UTC 2017


#41228: No way to get the post ID after a comment is deleted
--------------------------+-----------------------------
 Reporter:  henry.wright  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 If we hook to {{{deleted_comment}}} we get given {{{$comment_ID}}} but at
 this point the comment has been removed from the database so we can't do
 things like this:
 {{{
 $comment = get_comment( $comment_ID );
 echo $comment->comment_post_ID;
 }}}

 Can we pass a 2nd arg to {{{do_action()}}}? For example:

 {{{do_action( 'deleted_comment', $comment->comment_ID, $post_id );}}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41228>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list