yuzuru-s/post-to-wp
Composer 安装命令:
composer require yuzuru-s/post-to-wp
包简介
This PHP library can easily post articles to wordpress with its thumbnail
关键字:
README 文档
README
Requirements
- PHP
-
=5.5 >=5.6, >=7.0
-
- ext-xmlrpc
- Composer
Installation
- Using composer
{
"require": {
"yuzuru-s/post-to-wp": "1.0.*"
}
}
$ php composer.phar update yuzuru-s/post-to-wp --dev
How to use
Please check sample code
<?php require __DIR__ . '/../vendor/autoload.php'; use YuzuruS\Wordpress\Post; // endpoint → example.com $wp = new Post(getenv(WP_USERNAME), getenv(WP_PASSWD), getenv(WP_ENDPOINT)); $res = $wp->makeCategories([ ['name' => 'かて1', 'slug' => 'cate1'], ['name' => 'かて2', 'slug' => 'cate2'], ]); $wp ->setTitle('たいとる') ->setDescription('本文') ->setKeywords(['key1','key2']) ->setCategories(['かて1','かて2']) ->setDate('2016-11-11') ->setWpSlug('entry') ->setThumbnail('https://www.pakutaso.com/shared/img/thumb/SAYA160312500I9A3721_TP_V.jpg') ->post();
How to run unit test
Run with default setting.
% vendor/bin/phpunit -c phpunit.xml.dist
Currently tested with PHP 7.0.0
History
License
Copyright (c) 2016 YUZURU SUZUKI. See MIT-LICENSE for further details.
Copyright
- Yuzuru Suzuki
统计信息
- 总下载量: 334
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-22