0
我想包括JSON响应postmeta。我已经得到了代码在这里:包括在WordPress REST API postmeta
https://torquemag.io/2015/07/working-with-post-meta-data-using-the-wordpress-rest-api/
我的问题是我在哪里添加此代码?我最初的想法是将它们添加到主题中的functions.php中。或者我应该将它添加到wp-includes中的functions.php中?
更新: 我添加的代码在REST的API的plugin.php和它的工作。这是首选方法吗?还是有更好的方法来做到这一点?
你应该添加主题的functions.php – vel
我加入它在REST的API的plugin.php和它的工作。应该有区别吗? –