kasia-boilerplate icon indicating copy to clipboard operation
kasia-boilerplate copied to clipboard

WordPress entity content printed out as [object Object]

Open mattKendon opened this issue 7 years ago • 0 comments

Getting the following error with the standard components in this project.

image

This happens because the content and excerpt fields are objects not strings.

{
    ...
    "content": {
        "rendered": "<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!<\/p>\n",
        "protected": false
    },
    ...
}

Replacing calls to parse(page.content) with parse(page.content.rendered) and parse(page.excerpt) with parse(page.excerpt.content) solves that issue.

Not sure if this has anything to do with the version of the rest-api WordPress plugin that is being used.

mattKendon avatar Dec 19 '16 15:12 mattKendon