Repository navigation
Conversation
Introduces the `WP_Option_Autoload` class, which holds the values stored in the `autoload` column of the options table, and uses it in the Option API instead of repeating the strings. There is no change in behavior: the stored values, return values and filters stay the same strings. Follow-up to [57920], [58105]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MKNCpEmZxEKHTbyKtmgpzZ
Uses the `WP_Option_Autoload` constants for expected values and for current input values. The legacy 'yes' and 'no' inputs stay as plain strings, since those tests check backward compatibility. Follow-up to [58105]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MKNCpEmZxEKHTbyKtmgpzZ
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. |
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.
Follow-up to #15567. That PR adds the
WP_Option_Autoloadconstants. This PR uses them in the option tests.This PR depends on #15567. Its first commit is the commit from that PR. Review only the second commit.
Rules used:
'on','off','auto','auto-on','auto-off').'yes'and'no'as plain strings where tests pass them in. These tests check backward compatibility for plugins that still send the raw strings, so they must keep sending the raw strings.If a constant gets the wrong value by mistake, the tests that use it would still pass.
Tests_Option_wpOptionAutoload, added in #15567, catches that: it checks each constant against the exact string stored in the database.Trac ticket:
Testing instructions
This PR only changes tests.
Setup: Node 24.18 or newer, and Docker running.
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Converting the test values and drafting this description. I reviewed the changes and ran the tests.
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.
🤖 Generated with Claude Code