Code Monkey home page Code Monkey logo

wp-api's Introduction

REST API

This is a project to create a JSON-based REST API for WordPress. This project is run by Ryan McCue and is part of the WordPress 2013 GSoC projects.

Build Status

Documentation

Read the plugin's documentation.

Installation

As a Plugin

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.

As Part of Core

Note: These instructions will likely be broken while in development. Please use the plugin method instead.

Drop wp-json.php into your WordPress directory, and drop class-wp-json-server.php into your wp-includes/ directory. You'll need working PATH_INFO on your server, but you don't need pretty permalinks enabled.

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]:sennza/Chassis.git api-tester
    vagrant plugin install vagrant-hostsupdater
  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. Browse to http://vagrant.local/wp/wp-admin/plugins.php and activate the WP API plugin

    Username: admin
    Password: password
    
  6. Browse to http://vagrant.local/wp/wp-admin/options-permalink.php and set the permalink structure to anything other than "Default"

  7. Browse to http://vagrant.local/wp-json/ (or if the permalink structure is still "Default," to http://vagrant.local/?json_route=/)

Testing

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

  1. SSH into your Vagrant box, and install PHPUnit:

    vagrant ssh
    sudo apt-get install php-pear
    sudo pear config-set auto_discover 1
    sudo pear install pear.phpunit.de/PHPUnit
  2. Clone WordPress development (including tests):

    git clone git://develop.git.wordpress.org/ /tmp/wordpress
    export WP_DEVELOP_DIR=/tmp/wordpress
  3. Run the testing suite:

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

Issue Tracking

All tickets for the project are being tracked on GitHub. Previous issues can be found on the GSOC Trac issue tracker, however new issues should not be filed there.

wp-api's People

Contributors

aaronjorbin avatar afurculita avatar cmmarslender avatar codebykat avatar ericpedia avatar japh avatar jmusal avatar kadamwhite avatar kokarn avatar matrixik avatar mattheu avatar osiux avatar pippinsplugins avatar pushred avatar rachelbaker avatar rmccue avatar thenbrent avatar tierra avatar tlovett1 avatar tobych avatar

Watchers

 avatar  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.