-
Notifications
You must be signed in to change notification settings - Fork 2
List /posts/<parent>/revisions
endpoint
#745
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
Conversation
2d9f10a
to
52cb9f6
Compare
scripts/setup-test-site.sh
Outdated
# TODO: The following doesn't create multiple revisions, but instead updates the existing revisions which is not what we need | ||
# # Create some exta revisions for testing | ||
# for i in {1..10}; | ||
# do | ||
# curl --user "$ADMIN_USERNAME":"$ADMIN_PASSWORD" -H "Content-Type: application/json" -d "{\"content\":\"content_revision_$i\"}" "http://localhost/wp-json/wp/v2/posts/$REVISIONED_POST_ID/autosaves" | ||
# done |
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.
@crazytonyli @jkmassel Any chance you know how to create multiple post revisions using the API? I only see the /posts/<parent_id>/autosaves
endpoint for creating a revision in the documentation, but using that only creates 1 revision and overrides it for subsequent calls.
I tried sending a POST
request to /posts/<parent_id>/revisions
, but the server seems to interpret that as a GET
request and returns the existing revisions.
I think I understand /revisions
and /autosaves
endpoints at a conceptual level, but I can't fully wrap my head around them in the documentation because there doesn't seem to be a POST request for /revisions
. So, if either of you have extra insight about how they work, I'd appreciate it.
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.
We chatted a little bit about this with Jeremy on a Slack call and he mentioned that the revisions are most likely created on the server side when a post is updated. I'll give that a shot and update the PR accordingly.
52cb9f6
to
e022d52
Compare
Follows established patterns to implement list
/posts/<parent>/revisions
endpoint.