Update v-add-wordpress-admin to use $phpver

This commit is contained in:
myvesta 2024-05-30 14:02:52 +02:00 committed by GitHub
parent 6a72798aba
commit 67b8376608
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,12 +65,14 @@ if ! command -v wp &> /dev/null; then
echo "WP CLI installed successfully."
fi
phpver=$(/usr/local/vesta/bin/v-get-php-version-of-domain "$domain")
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
cd /home/$USER/web/$domain/public_html
sudo -u $USER wp user create $username $email --role=administrator --user_pass="$password"
sudo -u $USER /usr/bin/php$phpver /usr/local/bin/wp user create $username $email --role=administrator --user_pass="$password" --skip-plugins=$(sudo -H -u$USER /usr/bin/php$phpver /usr/local/bin/wp plugin list --field=name | tr '\n' ',') --skip-themes;
#----------------------------------------------------------#
# Vesta #