Can I develop separate API Calls with php for mobi

2019-09-12 03:21发布

i have the latest installation of wordpress. what i want to do is this:

Suppose i have a site at www.mysite.com and it is running wordpress now i want to create API for mobile app to get data from site using php.

can i create separate API for to get data from wordpress site?

if it can, How to create?

3条回答
劳资没心,怎么记你
2楼-- · 2019-09-12 03:48

Try - WP REST API V2

http://v2.wp-api.org/

downlaod plugin and install it.

https://wordpress.org/plugins/json-rest-api/

just type /wp-json/wp/v2/posts in end of your site url and you will get all post.

for get all post

www.mysite.com/wp-json/wp/v2/posts

For the search functionality - search test post

/wp-json/wp/v2/posts?filter[s]=test

much more details from this link http://v2.wp-api.org/reference/posts/

Note for best result use latest version of WP

other is you can also try Json api plugin but this 1 is best.

查看更多
一纸荒年 Trace。
3楼-- · 2019-09-12 04:00

Install JSON API plugin for web services here is the link https://wordpress.org/plugins/json-api/

you can also make extra web service and change webservice by modifying plugin files.

查看更多
一纸荒年 Trace。
4楼-- · 2019-09-12 04:12

You can try WP REST API. Install this plugin to your wordpress site then, you can access your site data through api calls.

查看更多
登录 后发表回答