alessandrominoccheri/wordpress-rest-api-client

There is no license information available for the latest version (v1.3.4) of this package.
Package info

github.com/AlessandroMinoccheri/wordpress-rest-api-client

pkg:composer/alessandrominoccheri/wordpress-rest-api-client

Statistics

Installs: 149

Dependents: 0

Suggesters: 0

Stars: 0

v1.3.4 2019-07-25 10:16 UTC

Requires

Suggests

Provides

None

Conflicts

None

Replaces

None

Unknown License d284152cb69d870be111e5274f4d039069724e4e

This package is auto-updated.

Last update: 2026-06-26 02:54:50 UTC


README

A Wordpress REST API client for PHP

👁 Travis

For when you need to make Wordpress REST API calls from some other PHP project, for some reason.

Installation

This library can be installed with Composer:

composer require alessandrominoccheri/wordpress-rest-api-client

The library will require an Http library to run. Guzzle is supported by the library, but you can use any Http library of your choise, so long as your write an adapter for that library.

To install Guzzle:

composer require guzzlehttp/guzzle

Usage

Example:

use Vnn\WpApiClient\Auth\WpBasicAuth;
use Vnn\WpApiClient\Http\GuzzleAdapter;
use Vnn\WpApiClient\WpClient;

require 'vendor/autoload.php';

$client = new WpClient(new GuzzleAdapter(new GuzzleHttp\Client()), 'http://yourwordpress.com');
$client->setCredentials(new WpBasicAuth('user', 'securepassword'));

$user = $client->users()->get(2);

print_r($user);

Testing

composer install
vendor/bin/peridot