• Does anyone know if a recent update to WordPress changed in any way the protected meta fields and how they work in relationship to the Rest API? I had written something using the REST API that would syndicate posts across multiple sites, it was working properly, however now that I went back a month or two later for final testing, any meta field that starts with an underscores will not update on a POST method through the REST API. Interestingly, any field not with an underscores updates just fine on the post.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter coleh

    (@coleh)

    Interesting piece to add to this. The post gets generated but when trying to debug the response it comes back with a 500 Internal Server Error on the POST request response. Any idea why this would be as the post is getting created? Is this related to the protected meta in any way? When I use Postman I get no issues with being able to update the protected meta.

    Moderator bcworkz

    (@bcworkz)

    Getting a 500 even though a post is created merely means the error occurred after the post was inserted. Coincidentally, meta fields are added/updated after a post is added/updated. This does not mean meta data is the cause, but it is a little suspicious. If Postman is successful with apparently the exact same request, I would look at how your app is assembling the data that will be POSTed. There’s something different between this and Postman’s version that’s not working.

    I don’t know of a specific change in REST that’s related, but it’s possible something was changed that previously accepted erroneous data structures is now more strict. This is not uncommon, it appears a WP update is breaking something, but in fact the cause is long time poor app coding that has suddenly been brought to light. These have often been common widespread practices that had worked though technically incorrect. I’ve no idea if this is what is happening here, only that it’s something to consider.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Rest API Protected Meta Fields’ is closed to new replies.