From cece8ff252059e1907802a956665212259ca3a4b Mon Sep 17 00:00:00 2001 From: Sarah Gooding Date: Mon, 4 Aug 2014 12:44:51 -0500 Subject: [PATCH 01/41] Added resources to navigation --- _includes/header.html | 1 + 1 file changed, 1 insertion(+) diff --git a/_includes/header.html b/_includes/header.html index 5996781..22d0550 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -10,6 +10,7 @@

WP REST API

  • Issues
  • Guides
  • Internals
  • +
  • Resources
  • Misc
  • From 41baa47657c51e532b2407305e4e61ef9073a6e0 Mon Sep 17 00:00:00 2001 From: Sarah Gooding Date: Mon, 4 Aug 2014 12:45:11 -0500 Subject: [PATCH 02/41] Added Resources doc --- resources.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 resources.md diff --git a/resources.md b/resources.md new file mode 100644 index 0000000..d83fc67 --- /dev/null +++ b/resources.md @@ -0,0 +1,69 @@ +--- +title: WP REST API Documentation +layout: internals +--- +Resources +========= + +Client Libraries +---------------- + +* [Backbone.js client][] +* [Node.js client][] +* [Angular.js client][] +* [PHP client][] +* [C# client][] +* [Mixradio API client for Windows Phone][] + +[Backbone.js client]: https://github.com/WP-API/client-js +[Node.js client]: https://github.com/kadamwhite/wordpress-rest-api +[Angular.js client]: https://github.com/jeffsebring/angular-wp-api +[PHP client]: https://github.com/WP-API/client-php +[C# client]: https://github.com/maxcutler/wp-api-csharp +[Mixradio API client for Windows Phone]: https://github.com/mixradio/wp-api-client + +Authentication +-------------- + +* [OAuth 1.0a server plugin][] +* [Basic Authentication][] + +[OAuth 1.0a server plugin]: https://github.com/WP-API/OAuth1 +[Basic Authentication]: https://github.com/WP-API/Basic-Auth + + +Tools +----- + +* [WP-CLI client][] +* [API Console][] +* [WP JSON API Connect][] +* [API client UI][] + +[WP-CLI client]: https://github.com/WP-API/client-cli +[API Console]: https://github.com/WP-API/api-console +[WP JSON API Connect]: https://github.com/WebDevStudios/WP_JSON_API_Connect +[API client UI]: https://github.com/modemlooper/Api-Clients + + +Slides & Videos +--------------- + +* [Rachel Baker: Put Your Content to REST With WP-API][] +* [The WordPress JSON REST API][] + +[Rachel Baker: Put Your Content to REST With WP-API]: http://wordpress.tv/2014/07/06/rachel-baker-put-your-content-to-rest-with-wp-api/ +[The WordPress JSON REST API]: https://speakerdeck.com/rmccue/wcmke2014 + +REST Info & Tools +----------------- + +* [More About REST][] +* [Postman HTTP Chrome Plugin][] +* [Paw HTTP App for OSX][] +* [JSONView Chrome Extension][] + +[More About REST]: http://www.restapitutorial.com/lessons/whatisrest.html +[Postman HTTP Chrome Plugin]: https://www.getpostman.com/ +[Paw HTTP App for OSX]: http://luckymarmot.com/paw +[JSONView Chrome Extension]: https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc From 707e4f6ee60626b74282b7679cddfc9e25d384ad Mon Sep 17 00:00:00 2001 From: Sarah Gooding Date: Mon, 4 Aug 2014 12:55:45 -0500 Subject: [PATCH 03/41] Added additional resources --- resources.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources.md b/resources.md index d83fc67..82484a4 100644 --- a/resources.md +++ b/resources.md @@ -51,9 +51,11 @@ Slides & Videos * [Rachel Baker: Put Your Content to REST With WP-API][] * [The WordPress JSON REST API][] +* [Heartbeat + WP REST API][] [Rachel Baker: Put Your Content to REST With WP-API]: http://wordpress.tv/2014/07/06/rachel-baker-put-your-content-to-rest-with-wp-api/ [The WordPress JSON REST API]: https://speakerdeck.com/rmccue/wcmke2014 +[Heartbeat + WP REST API]: http://www.getsource.net/wp-content/uploads/2014/08/WCNYC-Heartbeat.pdf REST Info & Tools ----------------- From b5a3fe12d046cead8a24e723dcb75f5c03c6001d Mon Sep 17 00:00:00 2001 From: Sarah Gooding Date: Tue, 5 Aug 2014 12:14:32 -0500 Subject: [PATCH 04/41] Added list of integrations with major WP plugins --- resources.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources.md b/resources.md index 82484a4..e407002 100644 --- a/resources.md +++ b/resources.md @@ -46,6 +46,18 @@ Tools [API client UI]: https://github.com/modemlooper/Api-Clients +WordPress Plugin Integrations +------------------------------ +* [BuddyPress][] +* [Pods Framework][] +* [WooCommerce][] + +[BuddyPress]: https://github.com/modemlooper/buddypress-json-api +[Pods Framework]: https://github.com/pods-framework/pods-json-api +[WooCommerce]: http://woothemes.github.io/woocommerce/rest-api + + + Slides & Videos --------------- From 1629cadeae3d91802b43e1bd027b660120dd0ee1 Mon Sep 17 00:00:00 2001 From: Josh Pollock Date: Tue, 5 Aug 2014 19:45:19 -0400 Subject: [PATCH 05/41] Add tutorials to resources list. #22 --- resources.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/resources.md b/resources.md index e407002..6ddb455 100644 --- a/resources.md +++ b/resources.md @@ -81,3 +81,14 @@ REST Info & Tools [Postman HTTP Chrome Plugin]: https://www.getpostman.com/ [Paw HTTP App for OSX]: http://luckymarmot.com/paw [JSONView Chrome Extension]: https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc + +Tutorials +--------- + +* [Using the WordPress REST API in a mobile app][] A detailed tutorial with complete example code on the basics of using the REST API in a app outside of WordPress. +* [WordPress REST API][] A basic introduction to the REST API. +* [A Look at the WordPress HTTP API][] Part of a series on the WordPress HTTP API, which can be used to interact with the WordPress REST API from within WordPress. + +[Using the WordPress REST API in a mobile app]: http://apppresser.com/using-wordpress-rest-api-mobile-app/) +[WordPress REST API]: http://themergency.com/wordpress-rest-api/ +[A Look at the WordPress HTTP API]: http://code.tutsplus.com/tutorials/a-look-at-the-wordpress-http-api-a-review--wp-32531 From b78917e7936e393170429787caed98a4f5f034f5 Mon Sep 17 00:00:00 2001 From: Scott Bolinger Date: Tue, 12 Aug 2014 14:30:13 -0700 Subject: [PATCH 06/41] fix broken resource link --- resources.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources.md b/resources.md index 6ddb455..2c6fcd1 100644 --- a/resources.md +++ b/resources.md @@ -89,6 +89,6 @@ Tutorials * [WordPress REST API][] A basic introduction to the REST API. * [A Look at the WordPress HTTP API][] Part of a series on the WordPress HTTP API, which can be used to interact with the WordPress REST API from within WordPress. -[Using the WordPress REST API in a mobile app]: http://apppresser.com/using-wordpress-rest-api-mobile-app/) +[Using the WordPress REST API in a mobile app]: http://apppresser.com/using-wordpress-rest-api-mobile-app/ [WordPress REST API]: http://themergency.com/wordpress-rest-api/ [A Look at the WordPress HTTP API]: http://code.tutsplus.com/tutorials/a-look-at-the-wordpress-http-api-a-review--wp-32531 From ff08f6348e11343aac47ae0d4182aebb0b33532f Mon Sep 17 00:00:00 2001 From: Josh Pollock Date: Wed, 3 Sep 2014 17:03:03 -0400 Subject: [PATCH 07/41] Added two more tutorials to the list. #22 --- resources.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources.md b/resources.md index 2c6fcd1..377809a 100644 --- a/resources.md +++ b/resources.md @@ -88,7 +88,12 @@ Tutorials * [Using the WordPress REST API in a mobile app][] A detailed tutorial with complete example code on the basics of using the REST API in a app outside of WordPress. * [WordPress REST API][] A basic introduction to the REST API. * [A Look at the WordPress HTTP API][] Part of a series on the WordPress HTTP API, which can be used to interact with the WordPress REST API from within WordPress. +* [An Introduction To The JSON REST API][] An introduction to intreacting with the REST API from inside of WordPress, showing how to retrive and display data from the current site or a remote site via GET requests. +* [An Introduction To The JSON REST API Part2][] More information on how interact with the REST API from inside of WordPress, showing how to create posts using data from a remote site, or create posts on a remote site. [Using the WordPress REST API in a mobile app]: http://apppresser.com/using-wordpress-rest-api-mobile-app/ [WordPress REST API]: http://themergency.com/wordpress-rest-api/ [A Look at the WordPress HTTP API]: http://code.tutsplus.com/tutorials/a-look-at-the-wordpress-http-api-a-review--wp-32531 +[An Introduction To The JSON REST API]: +http://torquemag.io/introduction-wordpress-new-universal-connector-json-rest-api/ +[An Introduction To The JSON REST API Part2]: http://torquemag.io/introduction-wordpress-rest-api-part-2/ From 2f3c65fe3dd66122114914cc8c78ac8c86a4aa40 Mon Sep 17 00:00:00 2001 From: Josh Pollock Date: Mon, 8 Sep 2014 20:34:04 -0400 Subject: [PATCH 08/41] Added Carl Alexander's REST API client tutorial to tutorials list. #22, redoing #26 --- resources.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources.md b/resources.md index 377809a..3b2a66e 100644 --- a/resources.md +++ b/resources.md @@ -88,12 +88,14 @@ Tutorials * [Using the WordPress REST API in a mobile app][] A detailed tutorial with complete example code on the basics of using the REST API in a app outside of WordPress. * [WordPress REST API][] A basic introduction to the REST API. * [A Look at the WordPress HTTP API][] Part of a series on the WordPress HTTP API, which can be used to interact with the WordPress REST API from within WordPress. +* [Designing a class: WordPress API client][] Guide to building a class for making GET requests to the REST API's users end point via the WordPress HTTP API. * [An Introduction To The JSON REST API][] An introduction to intreacting with the REST API from inside of WordPress, showing how to retrive and display data from the current site or a remote site via GET requests. * [An Introduction To The JSON REST API Part2][] More information on how interact with the REST API from inside of WordPress, showing how to create posts using data from a remote site, or create posts on a remote site. [Using the WordPress REST API in a mobile app]: http://apppresser.com/using-wordpress-rest-api-mobile-app/ [WordPress REST API]: http://themergency.com/wordpress-rest-api/ [A Look at the WordPress HTTP API]: http://code.tutsplus.com/tutorials/a-look-at-the-wordpress-http-api-a-review--wp-32531 +[Designing a class: WordPress API client]: http://carlalexander.ca/designing-class-wordpress-api-client [An Introduction To The JSON REST API]: http://torquemag.io/introduction-wordpress-new-universal-connector-json-rest-api/ [An Introduction To The JSON REST API Part2]: http://torquemag.io/introduction-wordpress-rest-api-part-2/ From 32061b49b26dc8513159f4aa72600a37ffdbc595 Mon Sep 17 00:00:00 2001 From: Sarah Gooding Date: Mon, 29 Sep 2014 06:05:37 -0500 Subject: [PATCH 09/41] Added bbPress API docs and new slides link --- resources.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources.md b/resources.md index 3b2a66e..5bcaae8 100644 --- a/resources.md +++ b/resources.md @@ -49,10 +49,12 @@ Tools WordPress Plugin Integrations ------------------------------ * [BuddyPress][] +* [bbPress][] * [Pods Framework][] * [WooCommerce][] [BuddyPress]: https://github.com/modemlooper/buddypress-json-api +[bbPress]: https://github.com/thenbrent/BB-API [Pods Framework]: https://github.com/pods-framework/pods-json-api [WooCommerce]: http://woothemes.github.io/woocommerce/rest-api @@ -64,10 +66,12 @@ Slides & Videos * [Rachel Baker: Put Your Content to REST With WP-API][] * [The WordPress JSON REST API][] * [Heartbeat + WP REST API][] +* [Taylor Lovett: JSON REST API for WordPress][] [Rachel Baker: Put Your Content to REST With WP-API]: http://wordpress.tv/2014/07/06/rachel-baker-put-your-content-to-rest-with-wp-api/ [The WordPress JSON REST API]: https://speakerdeck.com/rmccue/wcmke2014 [Heartbeat + WP REST API]: http://www.getsource.net/wp-content/uploads/2014/08/WCNYC-Heartbeat.pdf +[Taylor Lovett: JSON REST API for WordPress]: http://www.slideshare.net/tlovett1/json-rest-api-for-wordpress-39599181 REST Info & Tools ----------------- @@ -96,6 +100,5 @@ Tutorials [WordPress REST API]: http://themergency.com/wordpress-rest-api/ [A Look at the WordPress HTTP API]: http://code.tutsplus.com/tutorials/a-look-at-the-wordpress-http-api-a-review--wp-32531 [Designing a class: WordPress API client]: http://carlalexander.ca/designing-class-wordpress-api-client -[An Introduction To The JSON REST API]: -http://torquemag.io/introduction-wordpress-new-universal-connector-json-rest-api/ +[An Introduction To The JSON REST API]: http://torquemag.io/introduction-wordpress-new-universal-connector-json-rest-api/ [An Introduction To The JSON REST API Part2]: http://torquemag.io/introduction-wordpress-rest-api-part-2/ From 04a9ff33f2530b11cce9860d587b9c35828f9b0f Mon Sep 17 00:00:00 2001 From: Sarah Gooding Date: Mon, 29 Sep 2014 07:14:25 -0500 Subject: [PATCH 10/41] Added link to contribute to docs on GitHub --- README.md | 4 ++-- misc.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7af2b16..4304288 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# WP-API Documentation Site +# WP REST API Documentation Site This repository is the source for -[WP-API's documentation](http://wp-api.github.io). We're working on making this +[WP REST API documentation](http://wp-api.github.io). We're working on making this documentation [the best in the world][gh-1], but we're not there yet! [gh-1]: https://github.com/WP-API/WP-API.github.io/issues/1 diff --git a/misc.md b/misc.md index 1986483..cf1046f 100644 --- a/misc.md +++ b/misc.md @@ -7,6 +7,8 @@ Miscellaneous * [Comparison][]: Compare the WordPress JSON REST API to the other WordPress JSON API projects * [Compatibility][]: Notes on inputting data as an "array," JSON data input, and HTTP method compatibility +* [Contribute][]: Contribute to WP REST API documentation, currently located on GitHub [Comparison]: misc/comparison.html [Compatibility]: misc/compatibility.html +[Contribute]: https://github.com/WP-API/WP-API.github.io From 6a4d2c0b3a70a756b438b6d1a5ba811553637975 Mon Sep 17 00:00:00 2001 From: Sarah Gooding Date: Mon, 3 Nov 2014 19:40:25 -0600 Subject: [PATCH 11/41] Changed docs site to use master branch of WP-API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default the Flatdoc theme we're using fetches the readme file of the repository’s default branch. Currently WP-API default is ‘develop’ so forced Flatdoc to use ‘master’ --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index a37697d..18b40fb 100644 --- a/index.html +++ b/index.html @@ -31,7 +31,7 @@ var sort = {}; for (var i = multi.length - 1; i >= 0; i--) { var bits = multi[i]; - var url = 'https://api.github.com/repos/'+bits.repo+'/contents/'+bits.filepath; + var url = 'https://api.github.com/repos/'+bits.repo+'/contents/'+bits.filepath+'?ref=master'; sort[bits.filepath] = i; urls.push(url); From e07f475a59ffc79d2288581db8ad98c1fc0f0d3d Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Thu, 6 Nov 2014 09:30:18 -0600 Subject: [PATCH 12/41] Update syntax highlighting configuration to fix deprecation warning. --- _config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 02941f8..5f2bd99 100644 --- a/_config.yml +++ b/_config.yml @@ -1,5 +1,5 @@ baseurl: / -pygments: true +highlighter: pygments markdown: kramdown kramdown: input: GFM From 7c6edecb1f921a886e83d67ea98d8e76fb9b1d79 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Thu, 6 Nov 2014 10:12:21 -0600 Subject: [PATCH 13/41] Switch to the rawgithub CDN for hotlinking the Flatdoc JS files. --- _layouts/guide.html | 2 +- _layouts/internals.html | 2 +- index.html | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_layouts/guide.html b/_layouts/guide.html index 9d295c2..cb998e0 100644 --- a/_layouts/guide.html +++ b/_layouts/guide.html @@ -16,7 +16,7 @@ - + diff --git a/_layouts/internals.html b/_layouts/internals.html index 6dd4f80..4cdfab1 100644 --- a/_layouts/internals.html +++ b/_layouts/internals.html @@ -16,7 +16,7 @@ - + diff --git a/index.html b/index.html index 18b40fb..47cc16f 100644 --- a/index.html +++ b/index.html @@ -12,13 +12,13 @@ - - + + - + From 77accd82060624dbd545289dffaa2257bb027b46 Mon Sep 17 00:00:00 2001 From: Josh Pollock Date: Fri, 7 Nov 2014 23:32:24 -0500 Subject: [PATCH 14/41] More tutorials #22 --- resources.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/resources.md b/resources.md index 5bcaae8..e358726 100644 --- a/resources.md +++ b/resources.md @@ -67,11 +67,13 @@ Slides & Videos * [The WordPress JSON REST API][] * [Heartbeat + WP REST API][] * [Taylor Lovett: JSON REST API for WordPress][] +* [K. Adam White: WordPress in Weird Places][] [Rachel Baker: Put Your Content to REST With WP-API]: http://wordpress.tv/2014/07/06/rachel-baker-put-your-content-to-rest-with-wp-api/ [The WordPress JSON REST API]: https://speakerdeck.com/rmccue/wcmke2014 [Heartbeat + WP REST API]: http://www.getsource.net/wp-content/uploads/2014/08/WCNYC-Heartbeat.pdf [Taylor Lovett: JSON REST API for WordPress]: http://www.slideshare.net/tlovett1/json-rest-api-for-wordpress-39599181 +[K. Adam White: WordPress in Weird Places]: http://kadamwhite.github.io/talks/2014/wcsf-node-wp/#/ REST Info & Tools ----------------- @@ -88,17 +90,27 @@ REST Info & Tools Tutorials --------- - +* [An Overview of the WordPress JSON API][] Detailed Overview of the REST API projects and helpful links. * [Using the WordPress REST API in a mobile app][] A detailed tutorial with complete example code on the basics of using the REST API in a app outside of WordPress. * [WordPress REST API][] A basic introduction to the REST API. * [A Look at the WordPress HTTP API][] Part of a series on the WordPress HTTP API, which can be used to interact with the WordPress REST API from within WordPress. * [Designing a class: WordPress API client][] Guide to building a class for making GET requests to the REST API's users end point via the WordPress HTTP API. -* [An Introduction To The JSON REST API][] An introduction to intreacting with the REST API from inside of WordPress, showing how to retrive and display data from the current site or a remote site via GET requests. +* [An Introduction To The JSON REST API][] An introduction to interacting with the REST API from inside of WordPress, showing how to retrieve and display data from the current site or a remote site via GET requests. * [An Introduction To The JSON REST API Part2][] More information on how interact with the REST API from inside of WordPress, showing how to create posts using data from a remote site, or create posts on a remote site. +* [Using AngularJS And JSON API In Your WordPress Theme][] An introduction to using the REST API, and Angular JS in a WordPress theme. +* [Working with Meta Data Using the JSON REST API][] Using the REST API to work with post meta data. +* [Working with Taxonomies Using the JSON REST API][] Using the REST API to work with taxonomies. +* [Processing Forms with AJAX Using the JSON REST API][] A guide to using the REST API to edit posts using AJAX. +[An Overview of the WordPress JSON API]:http://webdevstudios.com/2014/10/16/an-overview-of-wordpress-json-api/ [Using the WordPress REST API in a mobile app]: http://apppresser.com/using-wordpress-rest-api-mobile-app/ [WordPress REST API]: http://themergency.com/wordpress-rest-api/ [A Look at the WordPress HTTP API]: http://code.tutsplus.com/tutorials/a-look-at-the-wordpress-http-api-a-review--wp-32531 [Designing a class: WordPress API client]: http://carlalexander.ca/designing-class-wordpress-api-client [An Introduction To The JSON REST API]: http://torquemag.io/introduction-wordpress-new-universal-connector-json-rest-api/ [An Introduction To The JSON REST API Part2]: http://torquemag.io/introduction-wordpress-rest-api-part-2/ +[Using AngularJS And JSON API In Your WordPress Theme]: http://1fix.io/blog/2014/11/05/angularjs-json-api-wp-theme/ +[Working with Meta Data Using the JSON REST API]: http://torquemag.io/working-meta-data-using-json-rest-api/ +[Working with Taxonomies Using the JSON REST API]: http://torquemag.io/working-taxonomies-using-json-rest-api/ +[Processing Forms with AJAX Using the JSON REST API]: http://torquemag.io/processing-forms-ajax-using-json-rest-api/ + From b32b6653659b1dfc032a2963ad67bb018f6b3097 Mon Sep 17 00:00:00 2001 From: Steve Grunwell Date: Fri, 21 Nov 2014 20:32:47 +0000 Subject: [PATCH 15/41] Fixed some broken links within the guides/ section --- guides/extending.md | 2 +- guides/getting-started.md | 4 ++-- guides/working-with-posts.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/guides/extending.md b/guides/extending.md index d013bb1..1469027 100644 --- a/guides/extending.md +++ b/guides/extending.md @@ -355,5 +355,5 @@ improving the built-in APIs. * [Internal Implementation][]: Learn about how the REST server works internally. [API Philosophy]: ../internals/philosophy.html -[Schema]: ../schema.html +[Schema]: ../../ [Internal Implementation]: ../internals/implementation.html diff --git a/guides/getting-started.md b/guides/getting-started.md index b9c05da..a8af490 100644 --- a/guides/getting-started.md +++ b/guides/getting-started.md @@ -473,6 +473,6 @@ get exploring! * [Authentication][auth]: Explore authentication options [Working with Posts]: working-with-posts.html -[schema]: ../schema.html -[auth]: ../authentication.html +[schema]: ../../ +[auth]: authentication.html [basic-auth-plugin]: https://github.com/WP-API/Basic-Auth diff --git a/guides/working-with-posts.md b/guides/working-with-posts.md index e0b57e2..ecfa71d 100644 --- a/guides/working-with-posts.md +++ b/guides/working-with-posts.md @@ -286,6 +286,6 @@ take a look at the other APIs, or look at documentation on the specifics. [Getting Started]: getting-started.html [Extending the API]: extending.html -[schema]: ../schema.html +[schema]: ../../ [WP_Query]: http://codex.wordpress.org/Class_Reference/WP_Query [array-style URL formatting]: ../compatibility.html#inputting-data-as-an-array From 9689ad3e0480f0d4e9e4043e0d1e25fead0c8b51 Mon Sep 17 00:00:00 2001 From: Waldo Jaquith Date: Fri, 23 Jan 2015 20:27:43 -0500 Subject: [PATCH 16/41] Remove 404ed link, unwrap text The link to the schema 404s, and I can't find such a document anywhere in the repo. Also, all of the lines of text were broken with carrige returns, which Markdown was rendering with `
    ` tags, leading to unfortunate text wrapping and oddly ragged edges, so I removed all single carriage returns and replaced them with spaces. --- guides/working-with-posts.md | 83 ++++++++---------------------------- 1 file changed, 17 insertions(+), 66 deletions(-) diff --git a/guides/working-with-posts.md b/guides/working-with-posts.md index e0b57e2..404e28a 100644 --- a/guides/working-with-posts.md +++ b/guides/working-with-posts.md @@ -4,25 +4,16 @@ layout: guide --- Working with Posts ================== -Back in the [Getting Started][] guide we used posts to demonstrate how to work -with the API, but only touched on some of the details. Let's take a more -detailed look at the Post API. +Back in the [Getting Started][] guide we used posts to demonstrate how to work with the API, but only touched on some of the details. Let's take a more detailed look at the Post API. Before We Start --------------- -This guide assumes you have a basic knowledge of the API, as well as the -prerequisites noted in the [Getting Started] guide. If you haven't already, make -sure you read that guide to ensure you know the basics. +This guide assumes you have a basic knowledge of the API, as well as the prerequisites noted in the [Getting Started] guide. If you haven't already, make sure you read that guide to ensure you know the basics. -This guide also assumes that you know how to send requests given how to use -them, so the examples will be HTTP requests. I recommend reading the cURL manual -or using a higher level tool if you don't know how to wrangle cURL. +This guide also assumes that you know how to send requests given how to use them, so the examples will be HTTP requests. I recommend reading the cURL manual or using a higher level tool if you don't know how to wrangle cURL. -The examples also pretend that your JSON base URL (`wp-json` in the main WP -directory) is located at `/`, which is probably not the case. For example, if -your base URL is `http://example.com/wp-json` and the example request is -`GET /posts`, you should should actually send the following: +The examples also pretend that your JSON base URL (`wp-json` in the main WP directory) is located at `/`, which is probably not the case. For example, if your base URL is `http://example.com/wp-json` and the example request is `GET /posts`, you should should actually send the following: GET /wp-json/posts HTTP/1.1 Host: example.com @@ -32,40 +23,22 @@ Higher level HTTP clients can usually handle this for you. Post Entities and Collections ----------------------------- -As mentioned previously, we can send a GET request to the main posts route to -get posts: +As mentioned previously, we can send a GET request to the main posts route to get posts: GET /posts HTTP/1.1 -This returns a list of Post objects. From a technical point of view, each object -is called an Entity (in this case, Post Entities), while the endpoint returns a -Collection (here, a Post Collection). +This returns a list of Post objects. From a technical point of view, each object is called an Entity (in this case, Post Entities), while the endpoint returns a Collection (here, a Post Collection). -Post Entities have certain [defined properties][schema], although which are set -depend on the context. For example, with embedded entities certain properties -may have different values; while the post parent entity is embedded, the parent -field inside this is only the ID. +Post Entities have certain [defined properties][schema], although which are set depend on the context. For example, with embedded entities certain properties may have different values; while the post parent entity is embedded, the parent field inside this is only the ID. Collection Views ---------------- -Post Collections can be modified by using various query string parameters. One -that you may already know is the `page` parameter. This parameter is used for -pagination, and while you can set it manually, it's also sent via the Link -headers to point you to the next and previous pages. A `context` parameter is -also available that we'll talk about later. +Post Collections can be modified by using various query string parameters. One that you may already know is the `page` parameter. This parameter is used for pagination, and while you can set it manually, it's also sent via the Link headers to point you to the next and previous pages. A `context` parameter is also available that we'll talk about later. -You can also change the post type via the `type` parameter. It's recommended -that you check the [available post types](#custom-post-types) before doing this, -as plugins may change what's available. +You can also change the post type via the `type` parameter. It's recommended that you check the [available post types](#custom-post-types) before doing this, as plugins may change what's available. -The last parameter is the `filter` parameter. This gives you full access to the -[WP_Query][] parameters, to alter the query to your liking. Depending on the -level of access you have, not all parameters will be available, so check the -[schema][] for the available parameters. A good assumption to make is that -anything you can put in a query on the site itself (such as `?s=...` for -searches) will be available. You can specify filter parameters in a request -using [array-style URL formatting][]. +The last parameter is the `filter` parameter. This gives you full access to the [WP_Query][] parameters, to alter the query to your liking. Depending on the level of access you have, not all parameters will be available, so check the [schema][] for the available parameters. A good assumption to make is that anything you can put in a query on the site itself (such as `?s=...` for searches) will be available. You can specify filter parameters in a request using [array-style URL formatting][]. Creating and Editing Posts @@ -79,22 +52,11 @@ The main posts route also has a creation endpoint: "title": "My Post Title" } -Here we send a Post entity that we've created locally to the server. These Post -entities are the same as Post entities served up by the server, but excluding -some fields which are immutable. For example, the ID and timezone fields cannot -be changed. +Here we send a Post entity that we've created locally to the server. These Post entities are the same as Post entities served up by the server, but excluding some fields which are immutable. For example, the ID and timezone fields cannot be changed. -When editing posts, it's helpful to pass the `edit` context along with your -request. This gives you extra data useful for editing, such as the unfiltered -content and title. This is not required, however it is recommended, as the -normal content and title fields have been filtered to correct HTML (such as via -the `wpautop` function), making them less than optimal for editing. +When editing posts, it's helpful to pass the `edit` context along with your request. This gives you extra data useful for editing, such as the unfiltered content and title. This is not required, however it is recommended, as the normal content and title fields have been filtered to correct HTML (such as via the `wpautop` function), making them less than optimal for editing. -You can also pass an `If-Unmodified-Since` header when editing posts with the -previous modification date to ensure that you don't accidentally overwrite edits -made in the meantime. Note that while dates in the `modified` field of the post -are in [RFC3339][] format, this header requires the use of [RFC1123][] (similar -to [RFC822][]). (Sorry about that, but the HTTP standard requires it.) +You can also pass an `If-Unmodified-Since` header when editing posts with the previous modification date to ensure that you don't accidentally overwrite edits made in the meantime. Note that while dates in the `modified` field of the post are in [RFC3339][] format, this header requires the use of [RFC1123][] (similar to [RFC822][]). (Sorry about that, but the HTTP standard requires it.) [RFC3339]: http://tools.ietf.org/html/rfc3339 [RFC1123]: http://tools.ietf.org/html/rfc1123 @@ -103,13 +65,9 @@ to [RFC822][]). (Sorry about that, but the HTTP standard requires it.) Custom Post Types ----------------- -Custom post types can be queried via the main post routes (`/posts` and -children) when they have been made public. The type can be set via the `type` -query parameter. +Custom post types can be queried via the main post routes (`/posts` and children) when they have been made public. The type can be set via the `type` query parameter. -Before working with custom post types, you should first check that the API has -support for the post type that you want to work with. This data is available via -the read-only APIs at `/posts/types`: +Before working with custom post types, you should first check that the API has support for the post type that you want to work with. This data is available via the read-only APIs at `/posts/types`: GET /posts/types HTTP/1.1 @@ -207,11 +165,7 @@ This should return a list of the available types: } } -The `meta.links.archives` value gives a nicer way to access given post type -archives for HATEOAS supporters and should always be used rather than manually -setting the `type` parameter directly, as CPTs may create their own route -structure instead. The `labels` fields should also always be used when -displaying the field, as these are run through WordPress' translations. +The `meta.links.archives` value gives a nicer way to access given post type archives for HATEOAS supporters and should always be used rather than manually setting the `type` parameter directly, as CPTs may create their own route structure instead. The `labels` fields should also always be used when displaying the field, as these are run through WordPress' translations. A similar API exists for post statuses at `/posts/statuses`: @@ -277,11 +231,8 @@ A similar API exists for post statuses at `/posts/statuses`: Next Steps ---------- -You should now understand more advanced usage of the post-related APIs, and be -able to implement a fully compliant client for the API. You might now want to -take a look at the other APIs, or look at documentation on the specifics. +You should now understand more advanced usage of the post-related APIs, and be able to implement a fully compliant client for the API. You might now want to take a look at the other APIs, or look at documentation on the specifics. -* [Schema][schema]: Full documentation of every parameter for the APIs. * [Extending the API][]: Create your own API endpoints. [Getting Started]: getting-started.html From f6ea34353db5d30df3c183e9b71ec9d5d8ab4f18 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Thu, 29 Jan 2015 13:38:32 -0600 Subject: [PATCH 17/41] Add utf-8 encoding and kramdown's line_width setting to config file. --- _config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_config.yml b/_config.yml index 5f2bd99..03d70cd 100644 --- a/_config.yml +++ b/_config.yml @@ -1,5 +1,7 @@ baseurl: / +encoding: utf-8 highlighter: pygments markdown: kramdown kramdown: input: GFM + line_width: 80 \ No newline at end of file From 4cb7f187e0b2005d82ac8f31f9e1189a91f7ccb2 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Thu, 29 Jan 2015 13:41:39 -0600 Subject: [PATCH 18/41] Clarify repository links and provide direct link to wp-api.org site. --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4304288..cb67dcb 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,15 @@ # WP REST API Documentation Site -This repository is the source for -[WP REST API documentation](http://wp-api.github.io). We're working on making this -documentation [the best in the world][gh-1], but we're not there yet! -[gh-1]: https://github.com/WP-API/WP-API.github.io/issues/1 +This repository is the source for [wp-api.org][gh-1]. It powers documentation for the +[JSON REST API (WP-API)][gh-2] plugin. We are working on making this documentation +the [best in the world][gh-3], but we're not there yet! + +**[Read the Docs ☞][gh-1]** + +[gh-1]: http://wp-api.org +[gh-2]: https://github.com/WP-API/WP-API +[gh-3]: https://github.com/WP-API/WP-API.github.io/issues/1 -## Running locally We recommend using Vagrant. Here's how you do that: From 064a2413ae93015a84c93ff7c7e7a8ad73e875d8 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Thu, 29 Jan 2015 13:42:40 -0600 Subject: [PATCH 19/41] Add instructions for running Jekyll locally and link to GH pages docs. --- README.md | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index cb67dcb..1d8b969 100644 --- a/README.md +++ b/README.md @@ -11,20 +11,35 @@ the [best in the world][gh-3], but we're not there yet! [gh-3]: https://github.com/WP-API/WP-API.github.io/issues/1 +## Running Locally + +This site is hosted on Github pages and powered by Jekyll. + + ```bash + bundle install + bundle exec jekyll serve -w + ``` + +then visit `localhost:4000` in your favorite browser. You can learn more about +using Jekyll and Github pages from their [documentation](https://help.github.com/articles/using-jekyll-with-pages/). + +### Using Vagrant + We recommend using Vagrant. Here's how you do that: -```bash -$ vagrant up -$ vagrant ssh - -# Following commands are now executed on the box -# These install everything you need -$ cd /vagrant -$ sudo apt-get update -$ sudo apt-get install ruby1.9.3 rubygems make -$ sudo gem install bundler -$ bundle install - -# To run the site: -$ jekyll serve -``` + ```bash + $ vagrant up + $ vagrant ssh + + # Following commands are now executed on the box + # These install everything you need + $ cd /vagrant + $ sudo apt-get update + $ sudo apt-get install ruby1.9.3 rubygems make + $ sudo gem install bundler + $ bundle install + + # To run the site: + $ jekyll serve + ``` + From 255a52b1f0460c24e630c3f6d3858271d49be8ce Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Thu, 29 Jan 2015 13:43:14 -0600 Subject: [PATCH 20/41] Add some basic style guidelines for our markdown formatting. --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 1d8b969..44f40b2 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,22 @@ We recommend using Vagrant. Here's how you do that: $ jekyll serve ``` + +## Style Guide + +This guide is a limited implementation of [Carwin's Markdown Style Guidelines](https://github.com/carwin/markdown-styleguide). + +- Wrap all lines at 80 characters. +- Denote **bold** text using the asterisk format: `**bold text**`. +- Denote _italic_ text using the underscore format: `_emphasized text_`. +- Force a linebreak by ending a line with two spaces, no more. +- Header text must use the `atx-style` with no closing `#` character. +- Include a space between the `#` and the text of the Header. +- List item lines exceeding 80 characters should, when wrapped, align + vertically with the beginning of the preceding line's text. +- **Inline code** must use single backticks and must not have spaces between + the backtick characters and the code. +- **Fenced code blocks** must be preceded and followed by a newline. +- When used inside _list items_, **fenced code blocks** must be indented as if + they were one level deeper that the list item that contains them. + From f3ab534001bcca56261f9b077b2f39d3f8adf48a Mon Sep 17 00:00:00 2001 From: Sarah Gooding Date: Wed, 11 Feb 2015 15:05:11 -0600 Subject: [PATCH 21/41] Keeping WP REST API naming consistent Changed JSON REST API to WP REST API --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44f40b2..00995cb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # WP REST API Documentation Site This repository is the source for [wp-api.org][gh-1]. It powers documentation for the -[JSON REST API (WP-API)][gh-2] plugin. We are working on making this documentation +[WP REST API (WP-API)][gh-2] plugin. We are working on making this documentation the [best in the world][gh-3], but we're not there yet! **[Read the Docs ☞][gh-1]** From 01ad541bfcbd537f2319b7975fec6c34aaa75786 Mon Sep 17 00:00:00 2001 From: Nikhil Vimal Date: Sat, 14 Feb 2015 20:28:38 -0600 Subject: [PATCH 22/41] Adding one more video to Slides & Videos to avoid any problems, just going to upload resources a few at a time :) --- resources.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources.md b/resources.md index e358726..a28f1f2 100644 --- a/resources.md +++ b/resources.md @@ -68,12 +68,14 @@ Slides & Videos * [Heartbeat + WP REST API][] * [Taylor Lovett: JSON REST API for WordPress][] * [K. Adam White: WordPress in Weird Places][] +* [Ryan McCue: The WordPress REST API (WCNYC)][] [Rachel Baker: Put Your Content to REST With WP-API]: http://wordpress.tv/2014/07/06/rachel-baker-put-your-content-to-rest-with-wp-api/ [The WordPress JSON REST API]: https://speakerdeck.com/rmccue/wcmke2014 [Heartbeat + WP REST API]: http://www.getsource.net/wp-content/uploads/2014/08/WCNYC-Heartbeat.pdf [Taylor Lovett: JSON REST API for WordPress]: http://www.slideshare.net/tlovett1/json-rest-api-for-wordpress-39599181 [K. Adam White: WordPress in Weird Places]: http://kadamwhite.github.io/talks/2014/wcsf-node-wp/#/ +[Ryan McCue: The WordPress REST API (WCNYC)]: https://wordpress.tv/2014/11/19/ryan-mccue-the-wordpress-rest-api/ REST Info & Tools ----------------- From ee793041845fba6debb1f7d9361b64cb721db0fc Mon Sep 17 00:00:00 2001 From: John S Long Date: Thu, 26 Feb 2015 09:58:55 -0600 Subject: [PATCH 23/41] Fix incorrectly rendered bash code block According to [Carwin's Markdown Style Guidelines](https://github.com/carwin/markdown-styleguide): > Fenced code blocks must be preceded and followed by a newline. This change adds a newline so that Jekyll will render the code block correctly. --- guides/authentication.md | 1 + 1 file changed, 1 insertion(+) diff --git a/guides/authentication.md b/guides/authentication.md index 6f22219..ec6e60e 100644 --- a/guides/authentication.md +++ b/guides/authentication.md @@ -72,6 +72,7 @@ you'll need to create a "consumer". This is an identifier for the application, and includes a "key" and "secret", both needed to link to your site. To create the consumer, run the following on your server: + ```bash $ wp oauth1 add From 0fe878cc835ef7ae2b43bc4c38fb7313b2b7d590 Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Fri, 13 Mar 2015 14:14:01 +1000 Subject: [PATCH 24/41] Update release process --- internals/release-process.md | 51 ++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/internals/release-process.md b/internals/release-process.md index a855760..b7b6626 100644 --- a/internals/release-process.md +++ b/internals/release-process.md @@ -5,30 +5,43 @@ layout: internals Release Process =============== -Here's the process used to generate new releases for the API plugin. -* Write changelog items for this release. Generate these automatically with the - following script: +Time to cook up a new release? Here's the recipe for the baker. - SINCE=$1 - if [[ -z $SINCE ]]; then - echo "usage: changelog " - exit 1 - fi +1. Bump the version in the code (key parts are the plugin header, and version + constant, but grepping is the best way to find them all) - OUTPUT=$(git log $SINCE... --reverse --format="format:- %w(80,0,4)%B") - OUTPUT=$(echo "$OUTPUT" | awk -v nlines=2 "/^ *git-svn-id:/ {for (i=0; i Date: Fri, 13 Mar 2015 14:14:54 +1000 Subject: [PATCH 25/41] Avoid manual wrapping --- internals/release-process.md | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/internals/release-process.md b/internals/release-process.md index b7b6626..b4f09c0 100644 --- a/internals/release-process.md +++ b/internals/release-process.md @@ -8,14 +8,11 @@ Release Process Time to cook up a new release? Here's the recipe for the baker. -1. Bump the version in the code (key parts are the plugin header, and version - constant, but grepping is the best way to find them all) +1. Bump the version in the code (key parts are the plugin header, and version constant, but grepping is the best way to find them all) -2. Generate the changelog! This is the most painful part of release, since we - need a useful changelog. Here's how: +2. Generate the changelog! This is the most painful part of release, since we need a useful changelog. Here's how: - 1. Run [this script](https://gist.github.com/rmccue/c95769c01aff2b486073) - to generate the Markdown. + 1. Run [this script](https://gist.github.com/rmccue/c95769c01aff2b486073) to generate the Markdown. 2. Change each item to match the following format: @@ -29,19 +26,15 @@ Time to cook up a new release? Here's the recipe for the baker. (props @author, [#179][gh-179], [#240][gh-240]) ``` - This description is either hand-written, or copied from the PR/issue - description. + This description is either hand-written, or copied from the PR/issue description. - 3. Reorder the changelog items to match how important they are. Major changes - at the top, then other changes further down. + 3. Reorder the changelog items to match how important they are. Major changes at the top, then other changes further down. 3. Commit the changelog, then tag the release on GitHub and push the tag. -4. Copy the codebase to the plugin's SVN directory, then copy the changelog into - the readme.txt there. Also ensure you version bump here. +4. Copy the codebase to the plugin's SVN directory, then copy the changelog into the readme.txt there. Also ensure you version bump here. 5. Commit readme/changes to trunk, then create new tag from that. -6. Write the release post, including the top (important) section from the - changelog, along with any other important information. +6. Write the release post, including the top (important) section from the changelog, along with any other important information. From 06dfa257a69a45e1a872a0ee553f6e35d5a4ad69 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Tue, 24 Mar 2015 11:33:00 -0500 Subject: [PATCH 26/41] Expanded on the release process steps. --- internals/release-process.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/internals/release-process.md b/internals/release-process.md index b4f09c0..a2a0506 100644 --- a/internals/release-process.md +++ b/internals/release-process.md @@ -32,9 +32,24 @@ Time to cook up a new release? Here's the recipe for the baker. 3. Commit the changelog, then tag the release on GitHub and push the tag. -4. Copy the codebase to the plugin's SVN directory, then copy the changelog into the readme.txt there. Also ensure you version bump here. +4. Copy the codebase to the plugin's SVN `trunk/` directory. -5. Commit readme/changes to trunk, then create new tag from that. +5. Update the `readme.txt` file with changelog **and** any changes from +the `README.MD file`. Bump the version number and review the `readme.txt` +file for any other needed changes as a result of this release. -6. Write the release post, including the top (important) section from the changelog, along with any other important information. +6. Commit the new release changes in `trunk`. +7. Test the release, and review the [plugin page](https://wordpress.org/plugins/json-rest-api/) for any process errors. + +8. Create a new directory in the SVN `tags/` directory with the new version +number. Copy the files from the SVN `trunk/` directory into the new `tags/x.x` +directory. + +9. Commit the tagged release changes in `tags/`. + +10. Write the release post for the [Make WordPress Core blog][mc]. Include the +top (important) section from the changelog, along with any other pertinent +information. + +[mc]: https://make.wordpress.org/core From 7113394c16106d6f6273bc253e81336201eefcf8 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Tue, 24 Mar 2015 11:39:03 -0500 Subject: [PATCH 27/41] Adjusted indenting in first few release list items. --- internals/release-process.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/internals/release-process.md b/internals/release-process.md index a2a0506..8e3e27d 100644 --- a/internals/release-process.md +++ b/internals/release-process.md @@ -8,27 +8,31 @@ Release Process Time to cook up a new release? Here's the recipe for the baker. -1. Bump the version in the code (key parts are the plugin header, and version constant, but grepping is the best way to find them all) +1. Bump the version in the code (key parts are the plugin header, and version +constant, but grepping is the best way to find them all) -2. Generate the changelog! This is the most painful part of release, since we need a useful changelog. Here's how: +2. Generate the changelog! This is the most painful part of release, since we +need a useful changelog. Here's how: - 1. Run [this script](https://gist.github.com/rmccue/c95769c01aff2b486073) to generate the Markdown. + 1. Run [this script][script] to generate the Markdown. 2. Change each item to match the following format: ``` - - Short feature summary + - Short feature summary. - Further long-text information can go here. The summary/description split - is basically the same as phpDoc formatting. Like phpDoc, not every commit - needs a long description + Further long-text information can go here. The summary/description + split is basically the same as phpDoc formatting. Like phpDoc, not + every commit needs a long description. (props @author, [#179][gh-179], [#240][gh-240]) ``` - This description is either hand-written, or copied from the PR/issue description. + This description is either hand-written, or copied from the PR/issue + description. - 3. Reorder the changelog items to match how important they are. Major changes at the top, then other changes further down. + 3. Reorder the changelog items to match how important they are. Major + changes at the top, then other changes further down. 3. Commit the changelog, then tag the release on GitHub and push the tag. @@ -52,4 +56,5 @@ directory. top (important) section from the changelog, along with any other pertinent information. +[script]: https://gist.github.com/rmccue/c95769c01aff2b486073 [mc]: https://make.wordpress.org/core From 10039d94a9e06efd07ccb22928d9b37045de9311 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Fri, 8 May 2015 15:00:20 -0700 Subject: [PATCH 28/41] Correct nonce key --- guides/authentication.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/authentication.md b/guides/authentication.md index ec6e60e..87941f3 100644 --- a/guides/authentication.md +++ b/guides/authentication.md @@ -29,7 +29,7 @@ Custom data models can extend `wp.api.models.Base` to ensure this is sent correctly for any custom requests. For developers making manual Ajax requests, the nonce will need to be passed -with each request. The API uses nonces with the action set to `wp_api`. These +with each request. The API uses nonces with the action set to `wp_json`. These can then be passed to the API via the `_wp_json_nonce` data parameter (either POST data or in the query for GET requests), or via the `X-WP-Nonce` header. From 12aba99775b543159b22c613b9944fa1e26c51e1 Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Mon, 20 Jul 2015 13:09:22 +0200 Subject: [PATCH 29/41] Add pointer to v2 site --- index.html | 2 ++ stylesheets/styles.css | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/index.html b/index.html index 47cc16f..17717f0 100644 --- a/index.html +++ b/index.html @@ -99,6 +99,8 @@ {% include sidebar.html %} +

    This site is for the legacy version (v1) of the API. View Version 2 Documentation

    +
    diff --git a/stylesheets/styles.css b/stylesheets/styles.css index 69db399..10481f0 100644 --- a/stylesheets/styles.css +++ b/stylesheets/styles.css @@ -836,4 +836,24 @@ code .comment { .title-area > div { position: relative; z-index: 1; +} +.v2-pointer { + padding: 30px 40px 40px; + max-width: 700px; + font-family: Open Sans,sans-serif; +} +.v2-pointer p { + padding: 10px; + text-align: center; + // border: 3px solid #2B3D50; + border-radius: 6px; + font-size: 22px; +} +.v2-pointer a { + display: inline-block; + background: #008CBA; + color: #fff; + padding: 1rem 2rem 1.0625rem; + margin: 10px 0px 1.25rem; + border-radius: 3px; } \ No newline at end of file From 75d2424dc0f9c6922f9494a018dc2e47495a2ee0 Mon Sep 17 00:00:00 2001 From: Tom de Bruin Date: Fri, 29 Jan 2016 12:51:12 +0000 Subject: [PATCH 30/41] Append titles with v1 --- _includes/header.html | 2 +- _layouts/guide.html | 2 +- _layouts/internals.html | 2 +- guides.md | 2 +- guides/authentication.md | 2 +- internals.md | 2 +- internals/implementation.md | 2 +- internals/philosophy.md | 2 +- internals/release-process.md | 2 +- misc.md | 2 +- misc/comparison.md | 2 +- misc/compatibility.md | 2 +- resources.md | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/_includes/header.html b/_includes/header.html index 22d0550..76fa0e3 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -3,7 +3,7 @@
    -

    WP REST API

    +

    WP REST API (v1)

    • WP REST API
    • Source on GitHub
    • diff --git a/_layouts/guide.html b/_layouts/guide.html index cb998e0..d8cca01 100644 --- a/_layouts/guide.html +++ b/_layouts/guide.html @@ -1,5 +1,5 @@ --- -title: WP REST API Documentation +title: WP REST API (v1) Documentation --- diff --git a/_layouts/internals.html b/_layouts/internals.html index 4cdfab1..fe1b902 100644 --- a/_layouts/internals.html +++ b/_layouts/internals.html @@ -1,5 +1,5 @@ --- -title: WP REST API Documentation +title: WP REST API (v1) Documentation --- diff --git a/guides.md b/guides.md index 0e529cb..fea1c01 100644 --- a/guides.md +++ b/guides.md @@ -1,5 +1,5 @@ --- -title: WP REST API Documentation +title: WP REST API (v1) Documentation layout: guide --- Guides diff --git a/guides/authentication.md b/guides/authentication.md index 87941f3..2a2c06d 100644 --- a/guides/authentication.md +++ b/guides/authentication.md @@ -1,5 +1,5 @@ --- -title: WP REST API Documentation +title: WP REST API (v1) Documentation layout: guide --- Authentication diff --git a/internals.md b/internals.md index 666b2b1..3edbd1c 100644 --- a/internals.md +++ b/internals.md @@ -1,5 +1,5 @@ --- -title: WP REST API Documentation +title: WP REST API (v1) Documentation layout: internals --- Internals diff --git a/internals/implementation.md b/internals/implementation.md index ea77134..ee3515d 100644 --- a/internals/implementation.md +++ b/internals/implementation.md @@ -1,5 +1,5 @@ --- -title: WP REST API Documentation +title: WP REST API (v1) Documentation layout: internals --- diff --git a/internals/philosophy.md b/internals/philosophy.md index dd4ed8b..6656502 100644 --- a/internals/philosophy.md +++ b/internals/philosophy.md @@ -1,5 +1,5 @@ --- -title: WP REST API Documentation +title: WP REST API (v1) Documentation layout: internals --- diff --git a/internals/release-process.md b/internals/release-process.md index 8e3e27d..b00ad67 100644 --- a/internals/release-process.md +++ b/internals/release-process.md @@ -1,5 +1,5 @@ --- -title: WP REST API Documentation +title: WP REST API (v1) Documentation layout: internals --- diff --git a/misc.md b/misc.md index cf1046f..788d7cc 100644 --- a/misc.md +++ b/misc.md @@ -1,5 +1,5 @@ --- -title: WP REST API Documentation +title: WP REST API (v1) Documentation layout: internals --- Miscellaneous diff --git a/misc/comparison.md b/misc/comparison.md index cc606a3..442c2a5 100644 --- a/misc/comparison.md +++ b/misc/comparison.md @@ -1,5 +1,5 @@ --- -title: WP REST API Documentation +title: WP REST API (v1) Documentation layout: internals --- # WordPress JSON API Comparison diff --git a/misc/compatibility.md b/misc/compatibility.md index a61a4f3..5603d73 100644 --- a/misc/compatibility.md +++ b/misc/compatibility.md @@ -1,5 +1,5 @@ --- -title: WP REST API Documentation +title: WP REST API (v1) Documentation layout: internals --- Compatibility diff --git a/resources.md b/resources.md index a28f1f2..b578cc4 100644 --- a/resources.md +++ b/resources.md @@ -1,5 +1,5 @@ --- -title: WP REST API Documentation +title: WP REST API (v1) Documentation layout: internals --- Resources From 45c704db1ae92cb596e5c7211ba440c44c2fe146 Mon Sep 17 00:00:00 2001 From: Tom de Bruin Date: Fri, 29 Jan 2016 12:52:42 +0000 Subject: [PATCH 31/41] Update meta description --- _layouts/guide.html | 2 +- _layouts/internals.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_layouts/guide.html b/_layouts/guide.html index d8cca01..73c9736 100644 --- a/_layouts/guide.html +++ b/_layouts/guide.html @@ -21,7 +21,7 @@ - + {% include header.html %} diff --git a/_layouts/internals.html b/_layouts/internals.html index fe1b902..37b6eb8 100644 --- a/_layouts/internals.html +++ b/_layouts/internals.html @@ -21,7 +21,7 @@ - + {% include header.html %} From 195a6b0b19c3eb7514c587488bb520f8b772444b Mon Sep 17 00:00:00 2001 From: Tom de Bruin Date: Fri, 29 Jan 2016 12:53:57 +0000 Subject: [PATCH 32/41] Update meta content --- _layouts/guide.html | 2 +- _layouts/internals.html | 2 +- index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_layouts/guide.html b/_layouts/guide.html index 73c9736..a809dc0 100644 --- a/_layouts/guide.html +++ b/_layouts/guide.html @@ -20,7 +20,7 @@ - + diff --git a/_layouts/internals.html b/_layouts/internals.html index 37b6eb8..2f552d4 100644 --- a/_layouts/internals.html +++ b/_layouts/internals.html @@ -20,7 +20,7 @@ - + diff --git a/index.html b/index.html index 17717f0..50fdf0e 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@ - + From 95ee0737cc7c87f4cce06ba91bf43139c3a74c67 Mon Sep 17 00:00:00 2001 From: Tom de Bruin Date: Fri, 29 Jan 2016 13:39:23 +0000 Subject: [PATCH 33/41] Link to v2 in header --- _includes/header.html | 1 + stylesheets/styles.css | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/_includes/header.html b/_includes/header.html index 76fa0e3..24331d6 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -12,6 +12,7 @@

      WP REST API (v1)

    • Internals
    • Resources
    • Misc
    • +
    • Version 2 Documentation
    diff --git a/stylesheets/styles.css b/stylesheets/styles.css index 10481f0..1170b02 100644 --- a/stylesheets/styles.css +++ b/stylesheets/styles.css @@ -608,6 +608,12 @@ body.no-literate .content pre > code:hover::-webkit-scrollbar-thumb { .header li a:hover { color: #6ABCDD; } +.header li a.v2-link { + background: #008CBA; + border-radius: 3px; + text-align: center; +} + @media (min-width: 480px) /* Tablet & Desktop */ { .header h1 { float: left; From 46de24c00d4175093f9ae998dfc9ff15e4677bba Mon Sep 17 00:00:00 2001 From: Tom de Bruin Date: Fri, 29 Jan 2016 14:08:33 +0000 Subject: [PATCH 34/41] Change title --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 50fdf0e..39a9978 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ --- -title: WP API Documentation +title: WP REST API (v1) Documentation --- From 376aedc8025084cc2e2a6488e226175ae6826259 Mon Sep 17 00:00:00 2001 From: Tom de Bruin Date: Fri, 29 Jan 2016 14:57:30 +0000 Subject: [PATCH 35/41] Add deprecated notices --- _includes/header.html | 2 +- _layouts/guide.html | 2 +- _layouts/internals.html | 2 +- guides.md | 2 +- guides/authentication.md | 2 +- index.html | 2 +- internals.md | 2 +- internals/implementation.md | 2 +- internals/philosophy.md | 2 +- internals/release-process.md | 2 +- misc.md | 2 +- misc/comparison.md | 2 +- misc/compatibility.md | 2 +- resources.md | 2 +- stylesheets/styles.css | 5 ++++- 15 files changed, 18 insertions(+), 15 deletions(-) diff --git a/_includes/header.html b/_includes/header.html index 24331d6..80399c9 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -3,7 +3,7 @@
    -

    WP REST API (v1)

    +

    WP REST API (v1 – Deprecated)

    • WP REST API
    • Source on GitHub
    • diff --git a/_layouts/guide.html b/_layouts/guide.html index a809dc0..af6a7ac 100644 --- a/_layouts/guide.html +++ b/_layouts/guide.html @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated --- diff --git a/_layouts/internals.html b/_layouts/internals.html index 2f552d4..10b2b7d 100644 --- a/_layouts/internals.html +++ b/_layouts/internals.html @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated --- diff --git a/guides.md b/guides.md index fea1c01..54852bd 100644 --- a/guides.md +++ b/guides.md @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated layout: guide --- Guides diff --git a/guides/authentication.md b/guides/authentication.md index 2a2c06d..9f24a7f 100644 --- a/guides/authentication.md +++ b/guides/authentication.md @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated layout: guide --- Authentication diff --git a/index.html b/index.html index 39a9978..50ebcfc 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated --- diff --git a/internals.md b/internals.md index 3edbd1c..50cdda0 100644 --- a/internals.md +++ b/internals.md @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated layout: internals --- Internals diff --git a/internals/implementation.md b/internals/implementation.md index ee3515d..7046097 100644 --- a/internals/implementation.md +++ b/internals/implementation.md @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated layout: internals --- diff --git a/internals/philosophy.md b/internals/philosophy.md index 6656502..9e6a9ce 100644 --- a/internals/philosophy.md +++ b/internals/philosophy.md @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated layout: internals --- diff --git a/internals/release-process.md b/internals/release-process.md index b00ad67..06c260f 100644 --- a/internals/release-process.md +++ b/internals/release-process.md @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated layout: internals --- diff --git a/misc.md b/misc.md index 788d7cc..23732cf 100644 --- a/misc.md +++ b/misc.md @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated layout: internals --- Miscellaneous diff --git a/misc/comparison.md b/misc/comparison.md index 442c2a5..e9ce511 100644 --- a/misc/comparison.md +++ b/misc/comparison.md @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated layout: internals --- # WordPress JSON API Comparison diff --git a/misc/compatibility.md b/misc/compatibility.md index 5603d73..4ea067d 100644 --- a/misc/compatibility.md +++ b/misc/compatibility.md @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated layout: internals --- Compatibility diff --git a/resources.md b/resources.md index b578cc4..886ba9b 100644 --- a/resources.md +++ b/resources.md @@ -1,5 +1,5 @@ --- -title: WP REST API (v1) Documentation +title: WP REST API (v1) Documentation - deprecated layout: internals --- Resources diff --git a/stylesheets/styles.css b/stylesheets/styles.css index 1170b02..568f45e 100644 --- a/stylesheets/styles.css +++ b/stylesheets/styles.css @@ -599,6 +599,9 @@ body.no-literate .content pre > code:hover::-webkit-scrollbar-thumb { .header h1 a:hover { color: #505050; } +.header h1 span { + font-size: 0.78em; +} .header li a { font-size: 0.78em; color: #eff0f1; @@ -862,4 +865,4 @@ code .comment { padding: 1rem 2rem 1.0625rem; margin: 10px 0px 1.25rem; border-radius: 3px; -} \ No newline at end of file +} From 6b21c1ccf17a9d91618f322a52b6be555dc4b93c Mon Sep 17 00:00:00 2001 From: Tom de Bruin Date: Fri, 29 Jan 2016 15:06:28 +0000 Subject: [PATCH 36/41] Redirect to v2 docs --- _config.yml | 4 +- index-deprecated.html | 107 ++++++++++++++++++++++++++++++++++++++++++ index.html | 105 +---------------------------------------- 3 files changed, 111 insertions(+), 105 deletions(-) create mode 100644 index-deprecated.html diff --git a/_config.yml b/_config.yml index 03d70cd..fa4e372 100644 --- a/_config.yml +++ b/_config.yml @@ -4,4 +4,6 @@ highlighter: pygments markdown: kramdown kramdown: input: GFM - line_width: 80 \ No newline at end of file + line_width: 80 +gems: + - jekyll-redirect-from diff --git a/index-deprecated.html b/index-deprecated.html new file mode 100644 index 0000000..50ebcfc --- /dev/null +++ b/index-deprecated.html @@ -0,0 +1,107 @@ +--- +title: WP REST API (v1) Documentation - deprecated +--- + + + + + + + + {{ page.title }} + + + + + + + + + + + + + + + + + + + +{% include header.html %} + +
      + +{% include sidebar.html %} + +

      This site is for the legacy version (v1) of the API. View Version 2 Documentation

      + +
      +
      + +{% include footer.html %} diff --git a/index.html b/index.html index 50ebcfc..5dab9c4 100644 --- a/index.html +++ b/index.html @@ -1,107 +1,4 @@ --- title: WP REST API (v1) Documentation - deprecated +redirect_to: "http://v2.wp-api.org" --- - - - - - - - - {{ page.title }} - - - - - - - - - - - - - - - - - - - -{% include header.html %} - -
      - -{% include sidebar.html %} - -

      This site is for the legacy version (v1) of the API. View Version 2 Documentation

      - -
      -
      - -{% include footer.html %} From ca4c62eaefa5ecb1f2df8df905241c2c277ea785 Mon Sep 17 00:00:00 2001 From: Tom de Bruin Date: Fri, 29 Jan 2016 16:15:37 +0000 Subject: [PATCH 37/41] Choose v1 or v2 documentation --- _config.yml | 2 -- index.html | 51 ++++++++++++++++++++++++++++++++++++++++-- stylesheets/styles.css | 29 ++++++++---------------- 3 files changed, 58 insertions(+), 24 deletions(-) diff --git a/_config.yml b/_config.yml index fa4e372..aea9b9c 100644 --- a/_config.yml +++ b/_config.yml @@ -5,5 +5,3 @@ markdown: kramdown kramdown: input: GFM line_width: 80 -gems: - - jekyll-redirect-from diff --git a/index.html b/index.html index 5dab9c4..837cbb1 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,51 @@ --- -title: WP REST API (v1) Documentation - deprecated -redirect_to: "http://v2.wp-api.org" +title: WP REST API Documentation --- + + + + + + + + {{ page.title }} + + + + + + + + + + + + +
      + +
      + + +
      +
      + +
      + +{% include sidebar.html %} + + + + +
      + +{% include footer.html %} diff --git a/stylesheets/styles.css b/stylesheets/styles.css index 568f45e..a522936 100644 --- a/stylesheets/styles.css +++ b/stylesheets/styles.css @@ -437,14 +437,13 @@ body.no-literate .content pre > code:hover::-webkit-scrollbar-thumb { font-weight: bold; display: inline-block; padding: 3px 25px; - border: solid 2px #2badad; - -webkit-border-radius: 20px; - border-radius: 20px; + -webkit-border-radius: 3px; + border-radius: 3px; margin-right: 15px; } .button, .button:visited { - background: #2badad; + background: #008CBA; color: #fff; text-shadow: none; } @@ -847,22 +846,12 @@ code .comment { z-index: 1; } .v2-pointer { - padding: 30px 40px 40px; - max-width: 700px; - font-family: Open Sans,sans-serif; -} -.v2-pointer p { - padding: 10px; + padding-top: 3em; + width: 100%; text-align: center; - // border: 3px solid #2B3D50; - border-radius: 6px; - font-size: 22px; + font-family: Open Sans,sans-serif; } -.v2-pointer a { - display: inline-block; - background: #008CBA; - color: #fff; - padding: 1rem 2rem 1.0625rem; - margin: 10px 0px 1.25rem; - border-radius: 3px; +.v2-pointer .button { + font-size: 2em; + margin: 0 0 1em 0; } From 7f167f2fd2c15665ba12187fdf37f2e71b01b7b9 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Thu, 25 Feb 2016 05:17:38 -0800 Subject: [PATCH 38/41] Notice to the user --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 837cbb1..85ee2b2 100644 --- a/index.html +++ b/index.html @@ -43,6 +43,7 @@

      WP REST API

      View Version 2 Documentation

      or continue to the Version 1 Documentation.

      +

      Note: If you activate both v1 and v2 on your website, then v1 will take priority and v2 will be inaccessible.

      From 22a08b6a82f076c7022b7aa2a1cf680a3a52ab66 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Thu, 25 Feb 2016 05:18:10 -0800 Subject: [PATCH 39/41] Eh, not that important. --- index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/index.html b/index.html index 85ee2b2..837cbb1 100644 --- a/index.html +++ b/index.html @@ -43,7 +43,6 @@

      WP REST API

      View Version 2 Documentation

      or continue to the Version 1 Documentation.

      -

      Note: If you activate both v1 and v2 on your website, then v1 will take priority and v2 will be inaccessible.

      From b1c8c44c8e9f781895cd1335d662c93a0d2d6069 Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Fri, 23 Sep 2016 11:54:15 -0400 Subject: [PATCH 40/41] Update Gemfile --- Gemfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 7b98eda..37f5eaa 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,2 @@ -# A sample Gemfile -source "https://rubygems.org" -gem 'github-pages' \ No newline at end of file +source 'https://rubygems.org' +gem 'github-pages', group: :jekyll_plugins From d93a2d74949e5b120c963cd16f0c7a6dfe48d4c8 Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Fri, 23 Sep 2016 11:54:28 -0400 Subject: [PATCH 41/41] Redirect main page to v2 --- _config.yml | 2 ++ index.html | 2 ++ 2 files changed, 4 insertions(+) diff --git a/_config.yml b/_config.yml index aea9b9c..413e2cb 100644 --- a/_config.yml +++ b/_config.yml @@ -5,3 +5,5 @@ markdown: kramdown kramdown: input: GFM line_width: 80 +gems: + - jekyll-redirect-from diff --git a/index.html b/index.html index 837cbb1..5be2320 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,7 @@ --- title: WP REST API Documentation +redirect_to: + - http://v2.wp-api.org/ ---