nunocodex/wpapi

WordPress API Library

Maintainers

Details

github.com/nunocodex/wpapi

Source

Installs: 20

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 1

Forks: 0

pkg:composer/nunocodex/wpapi

v1.3.0 2018-05-09 23:38 UTC

This package is not auto-updated.

Last update: 2025-10-12 11:10:35 UTC


README

This is library for access to WordPress API websites easy.

Installation

You can simply install with composer:

composer require nunocodex/wpapi

Readme is working progress

// GuzzleHttp options
$wpapiClientOptions = [
    'base_uri' => 'http://example.com/',
    'verify' => false,
    'auth' => [ 'user', 'pass' ]
];

// It's a GuzzleHttp extended class so you can bind
// the client with WpApiClientInterface for no change
// anything in this code.
$wpapiClient = new WpApiClient($wpapiClientOptions);

// WpApi object
$wpapi = new WpApi($wpapiClient);

$posts = $wpapi->posts()->embed()->filter([ 'order' => 'asc' ])->pagination(10)->get();