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.
Description of the Change
Adds a REST API endpoint at
/wp-json/elasticpress/v1/features
for updating feature settings. The endpoint uses the settings schema added to features by #3655 to provide validation for updating theep_feature_settings
via aPUT
request.This PR also creates a
Dashboard
screen class to register the endpoint (for consistency with Sync). The name dashboard was for consistency with thedashboard-page.php
file used to render it.How to test the Change
OPTIONS
request to/wp-json/elasticpress/v1/features
. The feature settings and their types and possible values should be shown as supportedargs
.ep_feature_settings
option from the database and unserialize it as JSON. Make modifications and send it as the body in aPUT
request to/wp-json/elasticpress/v1/features
. Valid changes according to the definitions in theOPTIONS
response should update the feature settings, and be reflected in the admin, while changes that are invalid should result in a 400 error.Changelog Entry
Added - Added a REST API endpoint at
elasticpress/v1/features
for updating feature settings.Credits
Props @JakePT
Checklist: