wp-api-client icon indicating copy to clipboard operation
wp-api-client copied to clipboard

WordPress API client

trafficstars

WordPress API Client

This is a PHP client for the WordPress JSON REST API. It's designed to work with WordPress without the need for an external library. This is done by leveraging the WordPress HTTP API through the WP_Httpclass.

Background

The client was created as part of an article on how to design a class.

Current limitations

This is still a work in progress. The client currently only supports the get_users method. You can also only authenticate using basic authentication.

Usage

$client = WP_API_Client::create('http://your.wordpress.org', 'your_token');

$users = $client->get_users();

Bugs

For bugs or feature requests, please create an issue.