当使用 Wordpress Rest API v2 请求帖子/页面/媒体时,我曾经收到标题、guid 和内容等字段的“原始”和“渲染”值。使用最新的 Wordpress 版本,“原始”字段似乎已经消失。我需要原始数据,因为它随着时间的推移是稳定的。插件可以向渲染数据添加(更改)数据。
我需要在 API 调用中提供(标头)参数来获取原始数据吗?
返回的原始数据(片段):
Array
(
[id] => 1016
[date] => 2017-11-08T16:18:29
[date_gmt] => 2017-11-08T15:18:29
[guid] => Array
(
[rendered] => https://example.com/wp-content/uploads/2017/03/image.jpg
[raw] => https://example.com/wp-content/uploads/2017/03/image.jpg
)
[modified] => 2017-11-08T16:18:39
[modified_gmt] => 2017-11-08T15:18:39
[slug] => 888
[status] => inherit
[type] => attachment
[link] => https://example.com/review/shopper/attachment/test/
[title] => Array
(
[raw] => shopper image
[rendered] => shopper image
)
Run Code Online (Sandbox Code Playgroud)
最新 WP API 数据:
Array
(
[id] => 1016
[date] => 2017-11-08T16:18:29
[date_gmt] => …Run Code Online (Sandbox Code Playgroud)