parteieuropa/wordpress-api

A PHP SDK for interacting with the WordPress REST API

Maintainers

Package info

github.com/Die-PARTEI-in-Europa/wordpress-api

pkg:composer/parteieuropa/wordpress-api

Transparency log

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.2.0 2026-07-05 11:51 UTC

This package is auto-updated.

Last update: 2026-07-05 12:04:51 UTC


README

Packagist License

A modern PHP SDK for interacting with the WordPress REST API. This SDK provides a clean, object-oriented interface for fetching posts, pages, menus, and other WordPress content with full pagination support.

📘 Full documentation & API reference — auto-generated from source, always up to date.

Installation

Install via Composer from Packagist:

composer require parteieuropa/wordpress-api

Requires PHP 8.0 or higher.

Quick Start

use WordPressApi\Client;

$client = new Client('https://example.com');

$posts = $client->posts()->all();
foreach ($posts->getData() as $post) {
    echo $post['title']['rendered'] . "\n";
}

Features

  • Posts & Pages: Fetch, filter, sort and paginate with a fluent query builder
  • Menus: List menus, fetch items, build hierarchical menu trees
  • Settings & Homepage: Read site configuration, intelligently resolve the homepage
  • Search: Full-text search across posts, pages, and multiple content types
  • Polylang Support: Filter posts and pages by language
  • Pagination: Built-in pagination with automatic link handling
  • Type Safety: Full PHP 8 type hints and return types
  • Well Tested: 104 unit & integration tests

Documentation

Detailed guides live in docs/:

The full class/method reference (generated from PHPDoc via phpDocumentor) is published at die-partei-in-europa.github.io/wordpress-api.

Testing

composer test           # unit + integration
composer test:unit      # unit only
composer test:integration  # requires docker-compose up -d

See docs/testing.md for the full setup.

License

MIT — see LICENSE.