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.
Read the plugin's documentation.
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.
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.
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:
-
Install Vagrant and VirtualBox.
-
Clone Chassis:
git clone --recursive [email protected]:sennza/Chassis.git api-tester vagrant plugin install vagrant-hostsupdater
-
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
-
Start the virtual machine:
vagrant up
-
Browse to http://vagrant.local/wp/wp-admin/ and activate the WP API plugin
Username: admin Password: password
-
Browse to http://vagrant.local/wp-json/
For testing, you'll need a little bit more:
-
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
-
Clone WordPress development (including tests):
git clone git://develop.git.wordpress.org/ /tmp/wordpress export WP_DEVELOP_DIR=/tmp/wordpress
-
Run the testing suite:
cd /vagrant/content/plugins/json-rest-api phpunit
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.