Repository navigation
Conversation
Author
|
Moving
The root problem is that Long term, I would love to split this:
This is a bigger Settings API change, so it should have its own Trac ticket. For now, let's keep the current approach in WordPress#12141 and bring over the useful tests from here. |
jorgefilipecosta
force-pushed
the
add/core-settings-ability
branch
from
October 8, 2026 09:29
a999491 to
358659f
Compare
gziolo
force-pushed
the
review/12141-regression-tests
branch
from
October 9, 2026 10:01
d7120a2 to
776942d
Compare
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 WordPress#12141, targeting its source branch.
The settings ability captures registered settings when the abilities registry is first accessed after
init. Registering core metadata onrest_api_initor registering it again during ability initialization makes the result depend on which API runs first.This change registers core settings metadata on
initand removes_wp_register_initial_settings_for_abilities(). It preserves the admin allowed-options lists so metadata registration does not change which options settings forms can save, including the email confirmation flow.Plugin settings exposed through
show_in_abilitiesmust also be registered oninitor earlier, with argument filters attached before registration.register_setting()emits an incorrect usage notice for later registrations, using the exposure value after filters run. The notice does not prevent registration.Tests cover registration timing, filtered exposure, custom public names, core metadata availability, and preservation of admin allowed-options lists. Existing ability tests now use the same registration timing contract. Comments and docblocks explain the expected behavior and its purpose.
Validation:
option,abilities-apigroups passed with no failures (810 tests, 3 skips, and one existing PHPUnit warning).git diff --checkpassed.PHPUnit used a temporary local bootstrap connected to the test database. Targeted filter:
Tests_Abilities_API_WpRegisterCore(SettingsGetAbility|Abilities)|Tests_Option_Registration|WP_Test_REST_Settings_Controller. Broader run:--group option,abilities-api.Trac ticket: https://core.trac.wordpress.org/ticket/64605
Use of AI Tools
AI assistance: Yes. Tool: OpenAI Codex. Used for implementation, regression tests, documentation, validation, and this PR description, following the contributor's design direction and iterative feedback.