Coder Social home page Coder Social logo

docs-v2's Introduction

These files comprise v2.wp-api.org. The endpoint documentation is programmatically, but manually, generated from the API.

Installation

You should have Ruby and gem installed.

Install Jekyll

Install bundler

Install gem dependencies

bundle install

Setup

Build the endpoint documentation:

ruby regenerate.rb

Run the website locally, and recompile files on change

bundle exec jekyll serve --watch

Open http://0.0.0.0:4000 in your browser to see the site

Notes

Styles use of Foundation v 5.5.3

docs-v2's People

Contributors

aaronjorbin avatar be-webdesign avatar danielbachhuber avatar ericandrewlewis avatar fabacab avatar iandunn avatar jblz avatar jimt avatar joehoyle avatar johanmynhardt avatar jtsternberg avatar kadamwhite avatar kuldipem avatar luciaisacomputer avatar mantismamita avatar miya0001 avatar mrbobbybryant avatar natewr avatar nylen avatar oskosk avatar pollyplummer avatar quasel avatar rachelbaker avatar rmccue avatar shelob9 avatar shprink avatar solal avatar thenbrent avatar vimes1984 avatar wanecek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs-v2's Issues

Document the search-replace --regex flag

There's currently no documentation on how the regex flag in the search-replace module functions, I noticed a bit of confusion on what it considers the replace element of the pattern, and what should be included (do you need the / wrappers to give flags to the pattern for example).

A documented block for this along with an example would be fantastic.

Front page search param is incorrect

GET /wp-json/wp/v2/posts?s=awesome is incorrect, and the search query will be ignored.

GET /wp-json/wp/v2/posts?filter[s]=awesome is correct.

MIgration with old version

I need to support the old version urls because of backward compatibility (I use this API on android mobile application) and I want to add new features exist on v2 of wp-api to my new versions
but when I download v2 I can not access routes and I got error with code json_no_route
can you suggest a solution? or there is a way to change v2 api url from wp-json/wp/v2/ to something else

Cloud you add some plugins to "Compatible Plugins on the WordPress.org Plugin Repository"?

I made some Plugin that using WP REST API(v2).
Cloud you add following plugins to "Compatible Plugins on the WordPress.org Plugin Repository"?

WP API Shortcodes

Simple Shortcode Plugin to get WordPress data from WP REST API(Version2)
https://wordpress.org/plugins/wpapi-shortcode-and-widgets/

Rest API Widgets

This is simple Widget Plugin using WP REST API. You can use following Widgets.

thanks.

Use absolute URLs for pages

While the single page effect is nice, it makes it painful to add links and negatively impacts SEO. Let's switch to absolute URLs. It's a static website, so pageloads should be fast enough.

Translation

Have any translation plan? How to contribute translating docs-vs of WP-API?

Add a "What Is A REST API?"

It's unsafe to assume that everyone reading the docs/ using the WordPress REST API knows what a REST API is. Hard to explain what the WordPress REST API is if you can't assume knowledge of REST APIs.

Docs should have a "What Is A REST API?" section that explains what such a thing is, in general and in the context of WordPress. I should write this. If someone else does first, +5 you.

getting the posts without authentication also

Hi, just i set up my own wordpress site and wp-api v2 beta installed, im getting the users list when i go to this url myurl/wp-josn/wp/v2/users im getting the list as json im wondering this doesn't require an authentication like access token like that. I have also installed Oauth server plugin but no use of it.

Addition of Examples & Use Cases

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

  • GET - posts, posts with filter, custom post type
  • POST - creating a new post
  • UPDATE - editing a post
  • DELETE - deleting a post

Will start with:

  • PHP (WordPress focused)
  • jQuery
  • AngularJS
  • BackboneJS
  • ReactJS

WP_API_Settings has changed to wpApiSettings

As of 11 January the WP_API_Settings localised javascript object has changed to wpApiSettings. This should be added to the "what's changed" section in the docs. (I'd add it myself, but I'm sure someone else will know better than me.)

Thanks!

Meta endpoint clarifications

When we get around to adding documentation for the meta endpoints, we should mention:

  1. Meta endpoints are only registered if the post type supports custom-fields. If the post type doesn't, the endpoints need to be manually registered WP-API/WP-API#1637
  2. Developers would be better off to add attributes to their resource, than using meta endpoints.

Error when trying to serve documentation locally

I am getting this error when running jekyll serve:

Configuration file: /repos/wp-api/docs-v2/_config.yml
            Source: /repos/wp-api/docs-v2
       Destination: /repos/wp-api/docs-v2/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
  Dependency Error: Yikes! It looks like you don't have redcarpet or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- redcarpet' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/! 
  Conversion error: Jekyll::Converters::Markdown encountered an error while converting 'changes-beta-1.md':
                    redcarpet
             ERROR: YOUR SITE COULD NOT BE BUILT:
                    ------------------------------------
                    redcarpet

Versions:

  • Ruby: 2.2.4p230
  • jekyll: 3.0.1
  • bundler: 1.11.2

Document capabilities required for endpoints

It would be nice for the documentation to mention what capabilities are required to read/write to the various endpoints. Eg, it seems no capabilities are required to create a comment but that currently isn't documented

Add documentation on how to run requests internally

For server side JavaScript rendering I want to call some of the API functions in PHP code. What is the best way to do this? For example, how can I fetch all the categories

xx/wp-json/wp/v2/categories

without a cURL request, but with normal PHP code within my WordPress plugin. Thanks!

Glossary for common terms

We should have a glossary for common terms (e.g. Resource, Controller, etc.) that can serve as an entry point to our documentation.

  • Resource
  • Controller
  • HTTP client
  • JSON parser
  • HEAD request
  • GET request
  • Routes
  • Endpoints
  • Meta Object
  • Class
  • Schema

OAuth example code referenced doesn't work and is outdated

On the Authentication page: http://v2.wp-api.org/guide/authentication/
Under "OAuth Authentication", an API Console: https://github.com/WP-API/api-console , is mentioned as a reference.

After spending a couple days trying to get it working, it became obvious to me that it wasn't designed for the v2 API, hasn't been updated in a year, and tries to do client-side authentication over OAuth sending a client key and secret in the clear from a JavaScript client.

I'd propose removing this reference link altogether as I don't feel it is a good starting place for people to learn how to use OAuth with the v2 API, and it teaches some really insecure practices that we should hope no one actually follows in their own application development.

Extending WP_REST_Posts_Controller

Hello

Can someone give me a link to a tutorial which deal with extending WP_REST_Posts_Controller

I need more control on the data return to my mobile app and add some other functions. The standard class doesn't.

Thanks a lot

Regards
Alexandre

Create a new post using REST API.

Hi I try to make a app using AngualrJs and Ionic with wordpress REST API.
In this app get the data from wordpress using wordpress REST API,

Now i try to create a new post through my app using REST API.

Its Give me the errror

{"code":"rest_cannot_create","message":"Sorry, you are not allowed to create new posts.","data":{"status":401}}

I also pass the header to and convert username and password to base64(YmxvYWdZXI6czdWx0QCNAIQ==) formet

$http call $http.defaults.headers.common.Authorization = 'Basic YmxvYWdZXI6czdWx0QCNAIQ==';

Create tags docs

Now that categories and tags are treated differently, we should have endpoint documentation for tags too.

Document the design decisions for our infrastructure classes

Our infrastructure classes are rich with history. Let's document why they exist, the problems they solve, and how they work:

  • WP_HTTP_Response
  • WP_HTTP_ResponseInterface
  • WP_JSON_DateTime
  • WP_JSON_Controller
  • WP_JSON_Request
  • WP_JSON_Response
  • WP_JSON_Server

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.