我正在尝试使用javascript和WP API插件获取 WordPress 网站标题
我没有找到任何关于如何获取站点名称的示例,但我在 开发人员指南的实体部分下找到了变量名称
function _updateTitle(documentTitle) {
document.querySelector('title').innerHTML =
documentTitle + ' | '+ $http.get('wp-json/name');
}
的输出字符串$http.get('wp-json/name')
是[object Object]
有谁知道如何使用修复这个?