Skip to content
/ WP-API Public
forked from WP-API/WP-API

A JSON-based REST API for WordPress

Notifications You must be signed in to change notification settings

wdbetts/WP-API

 
 

Repository files navigation

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
    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:https://vagrant.local/wp/wp-admin/ and activate the WP API plugin

    Username: admin
    Password: password
    
  6. Browse to http:https://vagrant.local/wp-json/

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:https://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 the GSoC Trac. Make sure you use the JSON REST API component.

About

A JSON-based REST API for WordPress

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 94.8%
  • JavaScript 5.2%