Repository navigation
Conversation
…ault_ping_status` to `closed`. Restores the conversion of a null value, which an unchecked checkbox on Settings > Discussion submits, lost in [47808]. This matches the `(string)` cast added for `'0'` in [56325]. See #66766.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @[email protected]. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
| * @dataProvider data_sanitize_option_discussion_status_null | ||
| * | ||
| * @covers ::sanitize_option |
There was a problem hiding this comment.
| * @dataProvider data_sanitize_option_discussion_status_null | |
| * | |
| * @covers ::sanitize_option | |
| * @covers ::sanitize_option | |
| * | |
| * @dataProvider data_sanitize_option_discussion_status_null |
Nit
Unchecking "Allow people to submit comments on new posts" (or the pingbacks setting) on Settings > Discussion submits
null. Since [47808] (5.5),sanitize_option()no longer convertsnullto'closed'fordefault_comment_statusanddefault_ping_status, because'' === $valuedoesn't matchnull. With a persistent object cache,get_option()can then returnnull, andwp_insert_post()fails with "Column 'comment_status' cannot be null".This casts the value before the empty-string check, matching the
(string)cast added for'0'in [56325], which restores the pre-[47808] behaviour fornullandfalse. Unit tests cover both options.Trac ticket: https://core.trac.wordpress.org/ticket/66766
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Tracing the bug to [47808], drafting the patch, unit test and ticket text; I reviewed, tested and reproduced it on local and production environments.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.