diff --git a/inc/clean-emails.php b/inc/clean-emails.php index 0b60b51..4f565cb 100644 --- a/inc/clean-emails.php +++ b/inc/clean-emails.php @@ -15,11 +15,6 @@ */ class Clean_Emails { - /** - * Holds the current comment's ID. - */ - private int $comment_id = 0; - /** * Holds the current comment. */ @@ -236,9 +231,8 @@ private function wrap_message(): string { * @return void */ private function setup_data( int $comment_id ): void { - $this->comment_id = $comment_id; - $this->comment = \get_comment( $this->comment_id ); - $this->post = \get_post( (int) $this->comment->comment_post_ID ); + $this->comment = \get_comment( $comment_id ); + $this->post = \get_post( (int) $this->comment->comment_post_ID ); } /** @@ -323,7 +317,7 @@ private function comment_action_links( array $actions ): void { * @return string */ private function comment_action_link( string $label, string $action ): string { - $url = \admin_url( \sprintf( 'comment.php?action=%s&c=%d', $action, $this->comment_id ) ); + $url = \admin_url( \sprintf( 'comment.php?action=%s&c=%d', $action, $this->comment->comment_ID ) ); return '' . \esc_html( $label ) . ''; }