WP-API / docs-v2

Documentation for version 2 of the API
http://v2.wp-api.org
58 stars 76 forks source link

Addition of Examples & Use Cases #46

Open royboy789 opened 8 years ago

royboy789 commented 8 years ago

Create a new section (with nav) sorted by language / framework. Each page (language/framework) should have at minimum the following examples:

Will start with:

royboy789 commented 8 years ago

If you have examples, please link me to articles / themes / plugins with code

royboy789 commented 8 years ago

Create Simple example one every Reference page (as needed) with further detailed in own page with link.

royboy789 commented 8 years ago

Starting to get some examples in, and checking formatting or if we want to go tabbed interface - https://github.com/WP-API/docs-v2/pull/51

baerkins commented 8 years ago

I think it would be important to have a generic example of calling arguments, such as:

http://demo.wp-api.org/wp-json/wp/v2/posts/?filter[ARG_NAME]=ARG_OPTION

This could be a simple line underneath the 'Arguments' heading.

Additionally, this same type of documentation could be applied to several other sections, such as Schema. Right now, all of these areas seem a little vague in their actual usage in an api call.

I hope this is the proper place to post this idea. If there is a better protocol, let me know!

soderlind commented 8 years ago

@royboy789 , I have a demo plugin that shows how to do an upload to the media library from the front-end (user must be logged in and have the upload_files capability). The plugin is tested with WP-API Version 2.0-beta13

The plugin is available at my site: https://soderlind.no/dropzonejs-wordpress-rest-api/

btw, here a similar demo that creates a custom endpoint: https://soderlind.no/dropzonejs-wordpress-rest-api-with-custom-endpoint/