{"id":9472,"date":"2020-09-14T11:30:48","date_gmt":"2020-09-14T02:30:48","guid":{"rendered":"http:\/\/hack.gpl.jp\/?p=6087"},"modified":"2020-09-19T18:35:54","modified_gmt":"2020-09-19T09:35:54","slug":"post-9472","status":"publish","type":"post","link":"https:\/\/hack.gpl.jp\/2020\/09\/14\/post-9472.html","title":{"rendered":"WordPress\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u3001wp-cli\u3092\u4f7f\u3063\u3066\u307f\u305f\u3089\u4fbf\u5229\u3060\u3063\u305f\uff01"},"content":{"rendered":"\n
\u5b58\u5728\u306f\u77e5\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u4f7f\u3063\u3066\u307f\u308b\u3068\u4fbf\u5229\u3067\u3057\u305f\u3002<\/p>\n\n\n\n
WP-CLI<\/a> \u306f WordPress<\/a> \u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u3059\u3002<\/p>https:\/\/wp-cli.org\/ja\/<\/a><\/cite><\/blockquote>\n\n\n\n
\u3064\u307e\u308a\u3001\u3053\u3093\u306a\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n
$ wp plugin list\n+----------------------------------------+----------+--------+---------+\n| name | status | update | version |\n+----------------------------------------+----------+--------+---------+\n| akismet | active | none | 4.1.6 |\n| amp | active | none | 2.0.1 |\n| autoptimize | active | none | 2.7.7 |\n| jetpack | active | none | 8.9 |\n| jquery-manager | active | none | 1.10.6 |\n| line-auto-post | active | none | 1.0.1 |\n| litespeed-cache | inactive | none | 3.4.2 |\n| multiple-domain-mapping-on-single-site | active | none | 1.0.4 |\n| ultimate-addons-for-gutenberg | active | none | 1.17.0 |\n| word-balloon | active | none | 4.12.0 |\n| wordpress-importer | active | none | 0.7 |\n| wpfront-scroll-top | active | none | 2.0.2 |\n| duplicate-post | active | none | 3.2.5 |\n+----------------------------------------+----------+--------+---------+<\/code><\/pre>\n\n\n\n
\u30b7\u30a7\u30eb\u304c\u4f7f\u3048\u308b\u74b0\u5883\u3060\u3063\u305f\u3089\u4f7f\u308f\u306a\u3044\u3068\u3001\u3082\u3063\u305f\u3044\u306a\u3044\u3067\u3059\u306d\uff01<\/p>\n\n\n\n
\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u629c\u7c8b<\/h3>\n\n\n\n
Termux\u74b0\u5883\u3067\u3082\u4f7f\u3048\u308b\u304b\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002\u8981\u4ef6\u306f\u3055\u304d\u307b\u3069\u306e\u30ea\u30f3\u30af\u306b\u8a18\u8f09\u3057\u3066\u3042\u308a\u307e\u3059\u304cPHP5.4\u301c\u3068UNIX\u7cfb\u306e\u74b0\u5883\u3060\u305d\u3046\u3067\u3059\u3002WordPress\u306f\u30013.7\u301c\u3002<\/p>\n\n\n\n
\u30b9\u30c6\u30c3\u30d7\uff11<\/h3>\n\n\n\n
\u9069\u5f53\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u3063\u3066\u304a\u304d\u307e\u3059\u3002\u4f8b\u3067\u306f\u3001home\u76f4\u4e0b\u306btmp\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u308a\u305d\u3053\u3067\u4f5c\u696d\u3057\u307e\u3059\u3002\u307e\u305a\u3001wp-cli.phar \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n\n\n\n
cd\nmkdir tmp\ncd tmp\ncurl -O https:\/\/raw.githubusercontent.com\/wp-cli\/builds\/gh-pages\/phar\/wp-cli.phar<\/code><\/pre>\n\n\n\n
\u30b9\u30c6\u30c3\u30d7\uff12<\/h3>\n\n\n\n
\u4e00\u5fdc\u3001\u78ba\u8a8d\u3067\u3059\u3002<\/p>\n\n\n\n
php wp-cli.phar --info<\/code><\/pre>\n\n\n\n
\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u51fa\u529b\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n
OS:\tLinux 4.14.141+ #1 SMP PREEMPT Wed May 6 10:13:36 CST 2020 aarch64\nShell:\t\/data\/data\/com.termux\/files\/usr\/bin\/bash\nPHP binary:\t\/data\/data\/com.termux\/files\/usr\/bin\/php\nPHP version:\t7.4.10\nphp.ini used:\t\/data\/data\/com.termux\/files\/usr\/lib\/php.ini\nWP-CLI root dir:\tphar:\/\/wp-cli.phar\/vendor\/wp-cli\/wp-cli\nWP-CLI vendor dir:\tphar:\/\/wp-cli.phar\/vendor\nWP_CLI phar path:\t\/data\/data\/com.termux\/files\/home\/tmp\nWP-CLI packages dir:\t\nWP-CLI global config:\t\nWP-CLI project config:\t\nWP-CLI version:\t2.4.0<\/code><\/pre>\n\n\n\n
\u30b9\u30c6\u30c3\u30d7\uff13<\/h3>\n\n\n\n
\u5b9f\u884c\u6a29\u9650\u3092\u3064\u3051\u3066\u3001\u30d1\u30b9\u304c\u898b\u3048\u308b\u3068\u3053\u308d\u306b\u79fb\u52d5\u3002<\/p>\n\n\n\n
chmod +x wp-cli.phar\nmv wp-cli.phar $PREFIX\/bin\/wp\n::\uff08\u3061\u3083\u3093\u3068\u898b\u3048\u308b\u304b\u78ba\u8a8d\uff09\n$ which wp\n\/data\/data\/com.termux\/files\/usr\/bin\/wp<\/code><\/pre>\n\n\n\n
\u30b9\u30c6\u30c3\u30d7\uff14<\/h3>\n\n\n\n
\u30bf\u30d6\u88dc\u5b8c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n
cd\nmkdir bin\ncd bin\nwget https:\/\/raw.githubusercontent.com\/wp-cli\/wp-cli\/v2.4.0\/utils\/wp-completion.bash\n\nvi ~\/.bash_profile<\/code><\/pre>\n\n\n\n
\u4ee5\u4e0b\u3092\u8ffd\u8a18<\/p>\n\n\n\n
source \/data\/data\/com.termux\/files\/home\/bin\/wp-completion.bash<\/code><\/pre>\n\n\n\n
\u53cd\u6620\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n
source ~\/.bash_profile<\/code><\/pre>\n\n\n\n
\u78ba\u8a8d<\/p>\n\n\n\n
$ wp \u203b\u3053\u3053\u3067\u30bf\u30d6\u30ad\u30fc\u3092\u62bc\u3057\u3066\u307f\u308b\u3068\u4ee5\u4e0b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\ncache cron help menu post-type shell theme \ncap db i18n network rewrite sidebar transient \ncli embed import option role site user \ncomment eval language package scaffold super-admin widget \nconfig eval-file maintenance-mode plugin search-replace taxonomy \ncore export media post server term <\/code><\/pre>\n\n\n\n
\u30b9\u30c6\u30c3\u30d7\uff15<\/h3>\n\n\n\n
\u5b9f\u969b\u306b\u4f7f\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002WordPress\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u3042\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4e00\u89a7\u3092\u51fa\u3059\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n\n\n\n
$ wp plugin list\n+----------------------------------------+----------+--------+---------+\n| name | status | update | version |\n+----------------------------------------+----------+--------+---------+\n| akismet | active | none | 4.1.6 |\n| amp | active | none | 2.0.1 |\n| autoptimize | active | none | 2.7.7 |\n| jetpack | active | none | 8.9 |\n| jquery-manager | active | none | 1.10.6 |\n| line-auto-post | active | none | 1.0.1 |\n| litespeed-cache | inactive | none | 3.4.2 |\n| multiple-domain-mapping-on-single-site | active | none | 1.0.4 |\n| ultimate-addons-for-gutenberg | active | none | 1.17.0 |\n| word-balloon | active | none | 4.12.0 |\n| wordpress-importer | active | none | 0.7 |\n| wpfront-scroll-top | active | none | 2.0.2 |\n| duplicate-post | active | none | 3.2.5 |\n+----------------------------------------+----------+--------+---------+<\/code><\/pre>\n\n\n\n
\u304a\u301c\uff01\u3000\u3053\u308c\u306f\u4fbf\u5229\u3067\u3059\u306d\u3002\u3044\u308d\u3093\u306a\u4f7f\u3044\u65b9\u304c\u3042\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u3092\u307f\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n\n\n\n
WP-CLI\u3000Quick Start<\/p>https:\/\/make.wordpress.org\/cli\/handbook\/guides\/quick-start\/<\/cite><\/blockquote>\n\n\n\n
\u3044\u308d\u3044\u308d\u4fbf\u5229\u306a\u4f7f\u3044\u65b9\u304c\u3042\u308b\u3068\u601d\u3046\u306e\u3067\u3001\u5099\u5fd8\u9332\uff1a\u301c\u3000\u3067\u7d39\u4ecb\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n