-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REST API: Adds the site reading options to the index #69106
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: -9 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
Flaky tests detected in dead145. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/13214441706
|
dead145
to
0fca1cc
Compare
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
// Seems to be coming from `enableComplementaryArea`. | ||
'/wp/v2/users/me', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to change the order here. Now that getTemplateId
uses the REST index, the settings request is triggered a bit later.
What?
Closes #68870.
PR exposes the site reading settings via the REST index, which allows low-capability users to preview and change templates.
Why?
The
/settings
endpoint requires themanage_options
capability to access the site settings and does not have a mechanism forreadonly
the settings.Until #48885 is resolved, the only option for exposing
readonly
settings is the REST API index.How
Use
getEntityRecord( state, 'root', '__unstableBase' )
to access newreadonly
settings.Note
I've not touched other places where these settings are used because it's not a matter of simple search and replace.
While not an issue for non-administrator users, some components also need to account for edited settings. Currently, that's impossible with
getEntityRecord( state, 'root', '__unstableBase' )
.Testing Instructions
P.S. You might see 403 requests for the Navigation block. That needs to be handled separately.
Testing Instructions for Keyboard
Same.
Screenshots or screencast