Trac #60281: Add tests for unsetting comment_notes_before in comment_form() - #13460
Open
akshayjain93 wants to merge 1 commit into
Open
Trac #60281: Add tests for unsetting comment_notes_before in comment_form()#13460akshayjain93 wants to merge 1 commit into
akshayjain93 wants to merge 1 commit into
Conversation
…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>
|
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 Unlinked AccountsThe 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trac ticket
https://core.trac.wordpress.org/ticket/60281
Summary
Adds unit test coverage for how
comment_notes_beforebehaves incomment_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_fieldsfilter —unset()-ing it there has no effect. The supported way to remove it is to empty itvia the
comment_form_defaultsfilter. Addresses @jorbin's request for an automatedtest 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 passphpunit --group comment→ 642 pass, no regressionsphpcs --standard=phpcs.xml.distcleanBackward 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.