wordpressのwp-cliでの公開方法
wordpressでwp-cliを使って自動で記事を公開する方法を調べた。
html化する
cat /root/content/test2.md|pandoc -f markdown -t html >/root/content/test
2.html
wordpressに登録する
/usr/local/bin/wp-cli.phar post create --post_type=post --post_title="test" --post_name="test" --post_status=publish --post_content="$(cat /root/content/test2.html)" --path=/data/wordpresspub
cd /data/wordpresspublic/html
lic/html/
Success: Created post 53.
コメントを残す