Support » Plugin: WP REST API (WP API) » Can post content_raw but not content. Also, suggestion for small change in docs

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Ryan McCue

    (@rmccue)

    I can post articles, but the content field is ignored. Oddly the content_raw works.

    Why is the content field ignored ?

    The content field is the parsed content ready for output onto the page, including HTML sanitisation, shortcode replacement and oEmbed parsing. The content_raw field contains the exact data as stored in the database, and it’s this value that can be edited.

    Also, I spent a while trying to post a different type of post using ‘post-type’ (https://github.com/WP-API/WP-API/blob/master/docs/schema.md). It works with ‘type’, I mis-read the docs, other people might too.

    Ah, sorry about that, the post-type bit is meant to be the ABNF for it, not the actual field name. That could be confusing though.

    groberts100

    (@groberts100)

    Understood, thanks.

    One other thing, I’d can Post a custom post type to WordPress and see the draft article, and although I can set the name and content_raw, I have not found out how to set any of the other fields of the custom post.

    Somebody else wrote the custom post type.

    Do I need to implement extra code for the Custom Post Type or adjust the syntax of the request’s body ?

    (I admit I have not read the docs for WordPress Custom Posts, I will do that now)

    Thanks again for making this useful plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can post content_raw but not content. Also, suggestion for small change in docs’ is closed to new replies.