Coder Social home page Coder Social logo

mike-merchant / wp-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wp-api/wp-api

0.0 1.0 0.0 2.9 MB

WP REST API - a JSON-based REST API for WordPress.

Home Page: http://wp-api.org

License: GNU General Public License v2.0

Shell 0.51% PHP 94.65% JavaScript 4.85%

wp-api's Introduction

WP REST API (WP-API)

Access your WordPress site's data through an easy-to-use HTTP REST API.

Build Status

WARNING

The "develop" branch is undergoing substantial changes and is NOT COMPLETE OR STABLE.

The "master" branch represents a BETA of our next version release.

The latest stable version is available from the WordPress Plugin Directory.

About

WordPress is moving towards becoming a fully-fledged application framework, and we need new APIs. This project was born to create an easy-to-use, easy-to-understand and well-tested framework for creating these APIs, plus creating APIs for core.

This plugin provides an easy to use REST API, available via HTTP. Grab your site's data in simple JSON format, including users, posts, taxonomies and more. Retrieving or updating data is as simple as sending a HTTP request.

Want to get your site's posts? Simply send a GET request to /wp-json/posts. Update user with ID 4? Send a POST request to /wp-json/users/4. Get all posts with the search term "awesome"? GET /wp-json/posts?filter[s]=awesome. It's that easy.

WP API exposes a simple yet easy interface to WP Query, the posts API, post meta API, users API, revisions API and many more. Chances are, if you can do it with WordPress, WP API will let you do it.

WP API also includes an easy-to-use JavaScript API based on Backbone models, allowing plugin and theme developers to get up and running without needing to know anything about the details of getting connected.

Check out our documentation for information on what's available in the API and how to use it. We've also got documentation on extending the API with extra data for plugin and theme developers!

There's no fixed timeline for integration into core at this time, but getting closer!

Installation

Drop this directory in and activate it. You need to be using pretty permalinks to use the plugin, as it uses custom rewrite rules to power the API.

Quick Setup

Want to test out WP-API and work on it? Here's how you can set up your own testing environment in a few easy steps:

  1. Install Vagrant and VirtualBox.

  2. Clone Chassis:

    git clone --recursive [email protected]:Chassis/Chassis.git api-tester
  3. Grab a copy of WP API:

    cd api-tester
    mkdir -p content/plugins content/themes
    cp -r wp/wp-content/themes/* content/themes
    git clone [email protected]:WP-API/WP-API.git content/plugins/json-rest-api
  4. Start the virtual machine:

    vagrant up
  5. Activate the plugin:

    vagrant ssh -c 'cd /vagrant && wp plugin activate json-rest-api'
  6. Set the permalink structure to something other than the default, in order to enable the http://vagrant.local/wp-json/ endpoint URL (if you skip this step, it can be accessed at http://vagrant.local/?json_route=/):

    vagrant ssh -c "cd /vagrant && wp rewrite structure '/%postname%/'"

You're done! You should now have a WordPress site available at http://vagrant.local; you can access the API via http://vagrant.local/wp-json/

To access the admin interface, visit http://vagrant.local/wp/wp-admin and log in with the credentials below:

Username: admin
Password: password

Testing

For testing, you'll need a little bit more:

  1. Clone the Tester extension for Chassis:

    # From your base directory, api-tester if following the steps from before
    git clone --recursive https://github.com/Chassis/Tester.git extensions/tester
  2. Run the provisioner:

    vagrant provision
    
  3. Log in to the virtual machine and run the testing suite:

    vagrant ssh
    cd /vagrant/content/plugins/json-rest-api
    phpunit

    You can also execute the tests in the context of the VM without SSHing into the virtual machine (this is equivalent to the above):

    vagrant ssh -c 'cd /vagrant/content/plugins/json-rest-api && phpunit'

Issue Tracking

All tickets for the project are being tracked on GitHub. You can also take a look at the recent updates for the project.

Previous issues can be found on the GSOC Trac issue tracker, however new issues should not be filed there.

License

GPLv2+

wp-api's People

Contributors

afurculita avatar codebykat avatar danielbachhuber avatar dimadin avatar edhurtig avatar ellatrix avatar ericandrewlewis avatar japh avatar jdgrimes avatar joehoyle avatar kadamwhite avatar kokarn avatar markoheijnen avatar mattheu avatar maxcutler avatar michaelarestad avatar natewr avatar nikv avatar osiux avatar pippinsplugins avatar pollyplummer avatar rachelbaker avatar rmccue avatar shelob9 avatar simonlampen avatar staylor avatar thenbrent avatar tierra avatar tlovett1 avatar tobych avatar

Watchers

 avatar

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.