PHPackages                             maneuver/channel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. maneuver/channel

ActiveLibrary[API Development](/categories/api)

maneuver/channel
================

PHP library for the Wordpress REST API

v0.0.8(7y ago)0448MITPHPPHP &gt;=5.4

Since May 5Pushed 7y ago2 watchersCompare

[ Source](https://github.com/maneuver-agency/channel)[ Packagist](https://packagist.org/packages/maneuver/channel)[ RSS](/packages/maneuver-channel/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (9)Used By (0)

PHP library for the Wordpress REST API
======================================

[](#php-library-for-the-wordpress-rest-api)

Currently only supports GET requests.

---

**TABLE OF CONTENTS:**

- [Installation](#installation)
- [Authentication](#authentication)
    - [Basic Authentication](#basic-authentication)
    - [API Token](#api-token)
    - [OAuth](#oauth)
- [Usage](#usage)
    - [Posts](#posts)
    - [Pages](#pages)
    - [Taxonomies &amp; Terms](#taxonomies-&-terms)
    - [Users](#users)
    - [Media](#media)
- [Custom Post Types](#custom-post-types)
- [Slightly more advanced stuff](#slightly-more-advanced-stuff)
    - [Endpoints](#endpoints)
    - [Guzzle](#guzzle)
    - [Custom Classes](#custom-classes)
- [Todo:](#todo)

---

Installation
------------

[](#installation)

Install via composer:

```
composer require maneuver/channel

```

And include the autoloader:

```
require('vendor/autoload.php');
```

Happy times. 🤙

Authentication
--------------

[](#authentication)

### Basic Authentication

[](#basic-authentication)

Make sure the [Basic Authentication](https://github.com/WP-API/Basic-Auth) plugin for Wordpress is installed and activated.
*(should only be used for development purposes, as stated by the repository)*

```
$channel = new \Maneuver\Channel([
  'uri' => 'http://example.com/wp-json/wp/v2/',
  'username' => 'your-username',
  'password' => 'your-password',
]);
```

### API Token

[](#api-token)

Make sure the [Rooftop API Authentication](https://github.com/davidmaneuver/rooftop-api-authentication) plugin is installed and activated.

```
$channel = new \Maneuver\Channel([
  'uri' => 'http://example.com/wp-json/wp/v2/',
  'token' => 'your-token',
]);
```

### OAuth

[](#oauth)

*Currently not implemented.*

Usage
-----

[](#usage)

### Posts

[](#posts)

Retrieve a list of all posts (where post\_type = 'post'):

```
$posts = $channel->getPosts();

echo count($posts);
```

Retrieve a post by ID:

```
$post = $channel->getPost(1);

echo $post->excerpt;
```

Using Twig? Fear not:

```
{{ post.title }}
{{ post.excerpt|raw }}
```

### Pages

[](#pages)

Retrieve a list of all pages:

```
$pages = $channel->getPages();

foreach ($pages as $page) {
  echo $page->title;
}
```

Retrieve a page by ID:

```
$page = $channel->getPage(1);

echo $page->content;
```

### Taxonomies &amp; Terms

[](#taxonomies--terms)

Retrieve all existing taxonomies:

```
$taxonomies = $channel->getTaxonomies();
```

Retrieve one taxonomy by slug:

```
$taxonomy = $channel->getTaxonomy('category'); // use singular taxonomy name

// Then you can retrieve its terms:
$terms = $taxonomy->terms();
```

Or retrieve the terms in one call using the 'get' method:

```
$terms = $channel->get('categories'); // use plural taxonomy name
```

### Users

[](#users)

Get all users:

```
$users = $channel->getUsers();

echo $users[0]->name;
```

### Media

[](#media)

Get all media:

```
$media = $channel->getMedia();
```

Custom Post Types
-----------------

[](#custom-post-types)

When you define a custom post type in your Wordpress installation, make sure you set the `show_in_rest` option to `true`. This exposes an endpoint in the REST API to retrieve the posts. [Read the docs](https://codex.wordpress.org/Function_Reference/register_post_type)

```
add_action('init', function(){

  register_post_type('product', [
    'labels' => [
      'name'          => 'Products',
      'singular_name' => 'Product',
    ],
    'public'        => true,
    'show_in_rest'  => true,
    'rest_base'     => 'products' // defaults to the post type slug, 'product' in this case
  ]);

});
```

Then use the general 'get' method:

```
$products = $channel->get('products'); // Pass in the 'rest_base' of the custom post type.
```

Slightly more advanced stuff
----------------------------

[](#slightly-more-advanced-stuff)

### Endpoints

[](#endpoints)

You can actually call any endpoint using the 'get' method:

```
$post_types = $channel->get('types');
$latest = $channel->get('posts?per_page=5');
```

Read more about all endpoints in the [REST API Handbook](https://developer.wordpress.org/rest-api/)

### Guzzle

[](#guzzle)

You can pass in more requestOptions for Guzzle:

```
$latest = $channel->get('posts?per_page=5', [
  'proxy' => 'tcp://localhost:8125',
]);
```

Read more about the Guzzle RequestOptions [here](http://docs.guzzlephp.org/en/latest/request-options.html).

### Custom Classes

[](#custom-classes)

Every call returns an object (or array of objects) extending the '\\Maneuver\\Models\\Base' class. You can define your own classes if needed.

NOTE: Don't extend the '\\Maneuver\\Models\\Base' class directly, you'll lose some functionality.

```
class MyPost extends \Maneuver\Models\Post {
  public function fullTitle() {
    return 'Post: ' . $this->title;
  }
}

class MyPage extends \Maneuver\Models\Page {

}

$channel->setCustomClasses([
  // 'type' => 'ClassName'
  // eg: 'user' => 'MyUser'
  // or:
  'post'    => 'MyPost',
  'page'    => 'MyPage',
  'product' => 'MyPost', // custom post type
]);

$post = $channel->getPost(1);

echo $post->fullTitle();

echo get_class($post);
// => 'MyPost'
```

---

Todo:
-----

[](#todo)

- More support for ACF fields
- Better support for images
- Add WP\_Query-like parameters
- OAuth authentication

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~95 days

Recently: every ~33 days

Total

8

Last Release

2681d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5129cee329ce51ea7b4aace680d208624ae7d6695165c47777c155e3602f3274?d=identicon)[maneuver](/maintainers/maneuver)

---

Top Contributors

[![davidmaneuver](https://avatars.githubusercontent.com/u/590050?v=4)](https://github.com/davidmaneuver "davidmaneuver (29 commits)")

---

Tags

phpapiwordpressREST API

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/maneuver-channel/health.svg)

```
[![Health](https://phpackages.com/badges/maneuver-channel/health.svg)](https://phpackages.com/packages/maneuver-channel)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k9.5M87](/packages/openai-php-laravel)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k409.0k6](/packages/theodo-group-llphant)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[resend/resend-php

Resend PHP library.

617.2M42](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
