从wc_get_order()到REST API数据 - WooCommerce
将wc_get_order返回的数据($ order) - > get_data()
与wc() - > gt; api-> get_endpoint_data('//wc/v3/v3/v3/v3/v3/get_data()
订单/'$订单); 休息端点,数据是相同的,除了第一个情况下,对于某些键,数据是一个对象而不是格式化的信息。
例如[date_created] => 2022-04-13T10:11:52
由REST返回,
[date_created] => WC_DateTime Object
(
[utc_offset:protected] => 7200
[date] => 2022-04-13 08:11:52.000000
[timezone_type] => 1
[timezone] => +00:00
)
在wc_get_order()返回的数据中,
是什么“变平”将其转换为数据的代码是什么其余API返回的那个?
Comparing the data returned by wc_get_order($order)->get_data()
to the data returned by the wc()->api->get_endpoint_data('/wc/v3/orders/' . $order);
REST endpoint, the data is the same, except for that in the first case, for some keys the data is an object instead of a formatted piece of information.
E.g. [date_created] => 2022-04-13T10:11:52
returned by REST, is like this
[date_created] => WC_DateTime Object
(
[utc_offset:protected] => 7200
[date] => 2022-04-13 08:11:52.000000
[timezone_type] => 1
[timezone] => +00:00
)
in the data returned by wc_get_order()
...
What's the code that "flattens" the data converting it to the one returned by the REST API?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)