nggiahao/wordpress-rest-api-client
Composer 安装命令:
composer require nggiahao/wordpress-rest-api-client
包简介
README 文档
README
A Wordpress REST API client for PHP
For when you need to make Wordpress REST API calls from some other PHP project, for some reason.
Installation
This library can be installed with Composer:
composer require vnn/wordpress-rest-api-client
The library will require an Http library to run. Guzzle is supported by the library, but you can use any Http library of your choise, so long as your write an adapter for that library.
To install Guzzle:
composer require guzzlehttp/guzzle
Usage
Example:
use Vnn\WpApiClient\Auth\WpBasicAuth; use Vnn\WpApiClient\Http\GuzzleAdapter; use Vnn\WpApiClient\WpClient; require 'vendor/autoload.php'; $client = new WpClient(new GuzzleAdapter(new GuzzleHttp\Client()), 'http://yourwordpress.com'); $client->setCredentials(new WpBasicAuth('user', 'securepassword')); $user = $client->users()->get(2); print_r($user);
Testing
composer install vendor/bin/phpunit
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-03-26