Skip to content

Trac #60281: Add tests for unsetting comment_notes_before in comment_form() - #13460

Open
akshayjain93 wants to merge 1 commit into
WordPress:trunkfrom
akshayjain93:trac-60281
Open

Trac #60281: Add tests for unsetting comment_notes_before in comment_form()#13460
akshayjain93 wants to merge 1 commit into
WordPress:trunkfrom
akshayjain93:trac-60281

Conversation

@akshayjain93

Copy link
Copy Markdown

Trac ticket

https://core.trac.wordpress.org/ticket/60281

Summary

Adds unit test coverage for how comment_notes_before behaves in comment_form().
It is part of the comment form defaults and is rendered outside the fields loop,
so it is not an entry in the array passed to the comment_form_fields filter —
unset()-ing it there has no effect. The supported way to remove it is to empty it
via the comment_form_defaults filter. Addresses @jorbin's request for an automated
test demonstrating the reported behavior.

Changes

  • tests/phpunit/tests/comment/commentForm.php: three new tests. No production code changes.

Testing

  • phpunit tests/phpunit/tests/comment/commentForm.php → 17 pass
  • phpunit --group comment → 642 pass, no regressions
  • phpcs --standard=phpcs.xml.dist clean

Backward compatibility

None. Test-only addition.

AI disclosure

Prepared with AI assistance (Claude Code / Claude Opus). A human contributor reviewed
the change, ran the full suite locally, and verified correctness before submission.

…form()`.

`comment_notes_before` is part of the comment form defaults and is rendered
outside the fields loop, so it is not present in the array passed to the
`comment_form_fields` filter. Add unit tests documenting that unsetting it via
`comment_form_fields` has no effect, that it can be emptied via the
`comment_form_defaults` filter, and that it is not a comment form field.

See #60281.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @jainakshay93.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

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