Skip to content

Update Post #351

@lazardanlucian

Description

@lazardanlucian

Updating a post seems to not work,
The issue is that POST /wp-json/wp/v2/posts/%ID% expects a specific set of arguments and values like:
{"title":"mytitle", "content":"mycontent"}

Instead, the library seems to grab a GET /wp-json/wp/v2/posts/%ID%
which is like so:
{"title":{"rendered":"mytitle"}, "content":{"rendered":"

mycontent

"}}

Then feeds it back to POST /wp-json/wp/v2/posts/%ID%


The library should GET /wp-json/wp/v2/posts/%ID%?context=edit

then grab
title->raw
content->raw
excerpt->raw
(etcetera)
and modify those if needed by user of library

then put them for POST /wp-json/wp/v2/posts/%ID%
as
{"titlle":"modified title", "content":"modified content", "excerpt": "modified excerpt"}


Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions