parteieuropa/wordpress-api
Composer 安装命令:
composer require parteieuropa/wordpress-api
包简介
A PHP SDK for interacting with the WordPress REST API
README 文档
README
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/:
- Architecture
- Usage
- Authentication
- Settings
- Homepage
- Menus
- Search
- Polylang Integration
- Testing & Development
- API Reference (cheat sheet)
- Roadmap
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.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-05