Skip to content

Remove redundant $comment_id property from Clean_Emails#181

Open
jdevalk wants to merge 3 commits intodevelopfrom
fix/redundant-comment-id-property
Open

Remove redundant $comment_id property from Clean_Emails#181
jdevalk wants to merge 3 commits intodevelopfrom
fix/redundant-comment-id-property

Conversation

@jdevalk
Copy link
Member

@jdevalk jdevalk commented Feb 5, 2026

Summary

  • Clean_Emails stored $this->comment_id as a separate property, duplicating $this->comment->comment_ID
  • The property was only used in one place: comment_action_link() at line 321
  • Removed the property, updated setup_data() and comment_action_link() to use $this->comment->comment_ID

Test plan

  • Verify comment notification emails still contain correct action links (Spam, Trash, Edit)
  • Verify comment moderation emails still contain correct action links (Approve, Spam, Trash, Edit)

🤖 Generated with Claude Code

The comment_id was stored separately but duplicated the value
available via $this->comment->comment_ID. Removed the property
and updated the single usage in comment_action_link().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

Test on Playground
Test this pull request on the Playground
or download the zip

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
1 0 1

⚠️ Warnings (1)

📁 comment-hacks.php (1 warning)
📍 Line 🔖 Check 💬 Message
0 textdomain_mismatch The "Text Domain" header in the plugin file does not match the slug. Found "yoast-comment-hacks", expected "comment-hacks".

🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@jdevalk jdevalk requested a review from aristath February 5, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants