从github(https://github.com/laposta/laposta-api-php)下载PHP Wrapper后,我在WordPress上运行下面的代码时得到一个空白的响应。
在PHP文件中使用时,API会返回正确的数据。
我确定这是一个简单的错误,有人能指点我吗?我使用了API文档和提供的示例,因此不确定为什么这不能正常工作。
require_once(get_stylesheet_directory_uri() . '/assets/laposta/lib/Laposta.php');
Laposta::setApiKey("MY_API_KEY");
Laposta::setHttpsDisableVerifyPeer(true);
$list = new Laposta_List();
$result = $list->get("MY_LIST_ID");
$members = $result['list']['members']['active'];
答案 0 :(得分:0)
解决。似乎我只使用require_once
的相对路径。