Replace Sync AJAX callback with REST API endpoint. #3643
Merged
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
Replaces the admin-ajax.php callbacks used by the Sync page with a REST API. This also adds support for additional arguments that are passed to the index helper:
include
indexables
lower_limit_object_id
offset
post_type
put_mapping
upper_limit_object_id
This PR updates the Sync page to use the REST API, but there is no UI for the additional parameters at this stage.
Closes #3627
How to test the Change
POST
requests towp-json/elasticpress/v1/sync
with the above parameters should perform the expected sync.GET
requests towp-json/elasticpress/v1/sync
should return the status of an in progress sync.DELETE
requests towp-json/elasticpress/v1/sync
should cancel an in progress sync.Changelog Entry
Credits
Props @JakePT
Checklist: