11
安装 WP-CLI:
docker exec -it php-wordpress1 /bin/bash
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
使用 WP-CLI 管理主题和插件:
cd /var/www/html
wp theme list --allow-root
wp theme list --update=available --allow-root
wp theme update --all --allow-root
wp plugin list --allow-root
wp plugin list --update=available --allow-root
wp plugin update --all --allow-root
wp plugin update plugin-name --allow-root
wp plugin activate plugin-name --allow-root
wp plugin deactivate plugin-name --allow-root