How does WordPress build an API environment?

Source: Internet
Author: User
Want to use WP do backstage, do a hybird application. I have not done hybirdapp, want to use JQUERYMOBILE+PHONEGAP or Appcan to complete

Just installed a plug-in called JSON API, it is true that you can export JSON data, but there seems to be some problems, such as the complex tags post no data, stiffness Niang found that is WP4.0, has joined the JSON support, found about WordPress JSON plug-ins and articles a lot, confused

What's the right way to build a WordPress JSON API?

Reply content:

Want to use WP do backstage, do a hybird application. I have not done hybirdapp, want to use JQUERYMOBILE+PHONEGAP or Appcan to complete

Just installed a plug-in called JSON API, it is true that you can export JSON data, but there seems to be some problems, such as the complex tags post no data, stiffness Niang found that is WP4.0, has joined the JSON support, found about WordPress JSON plug-ins and articles a lot, confused

What's the right way to build a WordPress JSON API?

The feeling of the Lord around a big circle, see the following link to describe the target, not the process
https://github.com/seajs/seajs/issues/545

According to the existing target, can not understand why use WP, want to return the JSON data (and the environment to support WP) directly on the PHP script just fine

With Echo json_encode (data), you can

Update by topic main Comment:

Thank you to answer, I mainly want to describe one of the problems I encountered, in fact, is to ask how to do the best, and I use WP is because I want to based on the information in the station to call ~

Since the purpose of using WP is based on the information in the WP station CALL, the idea is more clear:

    1. How to export information in WP station (based on JSON)
    2. How to use this information in the hybrid app

The problem description of the main question does not concern the hybrid app.

Fan Qiang search WordPress JSON API with Google

The first result is: https://wordpress.org/plugins/json-api/

There is a full set of JSON API installation and use tutorial,

1.3. Responses
The standard response format-JSON API is (as-May has guessed) JSON.

Example response from Http://localhost/wordpress/?json=1 called on a default WordPress installation (formatted For readability):

{"Status": "OK", "Count": 1, "count_total": 1, "pages": 1, "posts": [{"id": 1, "type": "Post", "  Slug ":" hello-world "," url ":" Http:\/\/localhost\/wordpress\/?p=1 "," title ":" Hello world! "," Title_plain ": "Hello world!", "Content": "

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!<\/p>\n "," excerpt ":" Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!\n "," date ":" 2009-11-11 12:50:19 "," Modified ":" 2009-11-11 12:50:19 ", "Categories": [], "tags": [], "author": {"id": 1, "slug": "admin", "name": "Admin", "First_Name": "", "last_name": "", "nickname": "", "url": "", "description": ""}, "Comments": [{"id": 1, "name": "Mr WordPress", "url": "http:\/\/wordpress.org\/", "Date": "2009-11-11 12:50:19", "Content": "

Hi, this is a comment.
To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.<\/p>\n", "parent": 0 } ], "comment_count": 1, "comment_status": "open" } ]}

From the return data, there are tags and post, can meet the needs of the main problem

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.