Skip to content

Commit

Permalink
Merge pull request #341 from Automattic/update-wordpress-feature
Browse files Browse the repository at this point in the history
fix(wordpress): mount `vip-config` to WP root, not `/wp-content`
  • Loading branch information
sjinks authored Aug 17, 2024
2 parents 9af8c3a + e74965b commit 0a65b0f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion features/src/wordpress/devcontainer-feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "wordpress",
"name": "WordPress",
"description": "Sets up WordPress into the Dev Environment",
"version": "2.6.0",
"version": "2.6.1",
"documentationURL": "https://github.com/Automattic/vip-codespaces/tree/trunk/features/src/wordpress",
"containerEnv": {
"WP_CLI_CONFIG_PATH": "/etc/wp-cli/wp-cli.yaml",
Expand Down
7 changes: 6 additions & 1 deletion features/src/wordpress/setup-wordpress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,18 @@ else
base=$(pwd)
fi

for i in client-mu-plugins images languages plugins themes vip-config; do
for i in client-mu-plugins images languages plugins themes; do
if [ -e "${base}/${i}" ]; then
sudo rm -rf "/wp/wp-content/${i}"
sudo ln -sf "${base}/${i}" "/wp/wp-content/${i}"
fi
done

if [ -e "${base}/vip-config" ]; then
sudo rm -rf "/wp/vip-config"
sudo ln -sf "${base}/vip-config" "/wp/vip-config"
fi

if [ -n "${WP_PERSIST_UPLOADS}" ]; then
sudo install -d -o "${MY_UID}" -g "${MY_GID}" -m 0755 /workspaces/uploads
sudo install -d -o "${MY_UID}" -g "${MY_GID}" -m 0755 /wp/wp-content
Expand Down
6 changes: 4 additions & 2 deletions features/src/wordpress/wp/config/wp-config-defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@
/**
* VIP Config
*/
if ( file_exists( ABSPATH . '/wp-content/vip-config/vip-config.php' ) ) {
require_once( ABSPATH . '/wp-content/vip-config/vip-config.php' );
if ( file_exists( ABSPATH . '/vip-config/vip-config.php' ) ) {
require_once ABSPATH . '/vip-config/vip-config.php';
} elseif ( file_exists( ABSPATH . '/wp-content/vip-config/vip-config.php' ) ) {
require_once ABSPATH . '/wp-content/vip-config/vip-config.php';
}

/**
Expand Down

0 comments on commit 0a65b0f

Please sign in to comment.