wpmetabox / mb-rest-api

Add custom fields to WordPress REST API
19 stars 12 forks source link

On POST, WP 4.7.3 seems to pass an object rather than a JSON string? #4

Closed btsimonh closed 7 years ago

btsimonh commented 7 years ago

line 84 complains that json_decode is being passed an array rather than a json string. A quick debug showed this. Maybe they changed something in WP 4.7.3? Also, if any of the meta-box fields is an array or an object, then strip_tags() complains, and the content of the array/object is destroyed on POST. so either way, writing meta-box data this way is currently broken.

btsimonh commented 7 years ago

Added a pull request which works for me....

rilwis commented 7 years ago

I've just merged your PR. It requires the development version of Meta Box to work. Can you check it please?

PS: Thanks for your contribution!