Quick Start
composer require parteieuropa/wordpress-api
use WordPressApi\Client;
$client = new Client('https://example.com');
$posts = $client->posts()->all();
foreach ($posts->getData() as $post) {
echo $post['title']['rendered'] . "\n";
}
Requires PHP 8.0+ and Composer. See the Authentication guide for Application Passwords.
Features
Posts & Pages
Fetch, filter, sort and paginate content with a fluent query builder.
Menus
List menus, fetch items, and build hierarchical menu trees.
Search
Full-text search across content types via the WordPress REST search endpoint.
Settings & Homepage
Read site configuration and intelligently resolve the homepage.
Polylang
Filter posts and pages by language when using the Polylang plugin.
Type Safety
Full PHP 8 type hints, custom exceptions, and 100+ unit & integration tests.
Resources