admin管理员组文章数量:1431726
I got a private API (Cliniko) I want for example the full list of clients to be listed where I want on a page. I know how APIs work, what I don't know is how to implement them in Wordpress.
Is there a plugin that can help me do it? Or, what's the better way to do it?
And yes I have searched google up to page 10(and clicked almost every single link) I have seen lots of guides or maybe things that can work but nothing consistent, and almost everything that could be good is at least 3 years old, that's why I'm asking here, so please don't be *****. Thank you very much for any help, that's very much appreciated.
I got a private API (Cliniko) I want for example the full list of clients to be listed where I want on a page. I know how APIs work, what I don't know is how to implement them in Wordpress.
Is there a plugin that can help me do it? Or, what's the better way to do it?
And yes I have searched google up to page 10(and clicked almost every single link) I have seen lots of guides or maybe things that can work but nothing consistent, and almost everything that could be good is at least 3 years old, that's why I'm asking here, so please don't be *****. Thank you very much for any help, that's very much appreciated.
Share Improve this question asked Apr 21, 2019 at 14:34 Steacy PaquetteSteacy Paquette 13 bronze badges1 Answer
Reset to default 0You can fetch data using wp_remote_get()
.
//API URL
$url = 'your api url';
// API RESPONSE
$response = wp_remote_get($url, "your headers goes here / use array to set multiple headers.");
you can then access content from $response
.
$response['body']; // will give you content.
wrap it with your own function name and add this code in your functions.php
file. Call the function from your custom page template file
.
本文标签: pluginsHow to get data from a private API and add it to wordpress pages
版权声明:本文标题:plugins - How to get data from a private API and add it to wordpress pages 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745568076a2663881.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论