Repository navigation
Abilities API: Mark the read-only settings with show_in_abilities - #16383
Draft
jorgefilipecosta wants to merge 3 commits into
Draft
jorgefilipecosta wants to merge 3 commits into
jorgefilipecosta wants to merge 3 commits into
Conversation
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. |
Post types accept `array( 'readonly' => true )` for `show_in_abilities`, which keeps them readable through abilities and marks them read only. Settings accept the same `readonly` key in their `show_in_abilities` array. The new `wp_is_writable_through_abilities()` function tells write abilities whether a `show_in_abilities` value allows writes. See #66844.
`core/settings-update` now writes only the settings whose `show_in_abilities` value allows writes, as `wp_is_writable_through_abilities()` tells. The WordPress address (`url`) and the administration email address (`email`) set `readonly` in their `show_in_abilities` array, with the same name and schema as before. This replaces the `READ_ONLY_OPTIONS` list of `WP_Abilities_Settings` and the `readonly` keyword in a setting's schema, so a single marker decides which settings are read only. See #64616, #66844.
jorgefilipecosta
force-pushed
the
update/settings-readonly-marker
branch
from
December 2, 2026 16:14
3bee4fd to
6ab9d83
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.
Stacked on #16288, only the last two commits belong to this PR.
Follow-up to #10892.
This PR makes the show_in_abilities readonly marker the only way to mark a setting as read only for core/settings-update:
Trac ticket: https://core.trac.wordpress.org/ticket/66899
Testing
Verify unit tests are passing:
AI disclosure: the change and tests were drafted with AI assistance (Claude Code).