From c8b1d62aef34e1da70ed4fc82c09bb9abece8ba9 Mon Sep 17 00:00:00 2001 From: Ian Dunn Date: Fri, 27 Aug 2021 12:56:21 -0700 Subject: [PATCH] make compatible across environments --- .wp-env.json | 6 ++++-- env/0-sandbox.php | 5 +---- readme.md | 1 + source/wp-content/themes/wporg-news-2021/functions.php | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.wp-env.json b/.wp-env.json index 38fff358..af1176f6 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -6,7 +6,8 @@ "FS_METHOD": "direct", "WP_ENVIRONMENT_TYPE": "local", "JETPACK_DEV_DEBUG": true, - "WPORG_SANDBOXED": true + "WPORG_SANDBOXED": true, + "WPORG_GIT_MUPLUGINS_DIR": "/var/www/html/vendor/wporg/wporg-mu-plugins/mu-plugins" }, "core": "WordPress/WordPress#5.8", "plugins": [ @@ -21,6 +22,7 @@ ], "mappings": { "env": "./env", - "wp-content/mu-plugins/0-sandbox.php": "./env/0-sandbox.php" + "wp-content/mu-plugins/0-sandbox.php": "./env/0-sandbox.php", + "vendor/wporg": "./vendor/wporg" } } diff --git a/env/0-sandbox.php b/env/0-sandbox.php index 4615330d..54609eae 100644 --- a/env/0-sandbox.php +++ b/env/0-sandbox.php @@ -8,7 +8,4 @@ defined( 'WPINC' ) || die(); -define( 'WPORG_GIT_MUPLUGINS_DIR', dirname( ABSPATH ) . '/vendor/wporg/wporg-mu-plugins' ); -// name better - how to distinguish from the muplugins in the git repo, the ones in meta.svn, and the ones in dotorg.svn -// this might need a different path for wp-env vs my local nginx env vs production -// maybe have composer install it into mu-plugins? +require_once WPORG_GIT_MUPLUGINS_DIR . '/blocks/global-header-footer/blocks.php'; diff --git a/readme.md b/readme.md index c978fd11..82fe3ced 100644 --- a/readme.md +++ b/readme.md @@ -26,6 +26,7 @@ These must be run in the project's root folder, _not_ in theme/plugin subfolders * Stop the environment: `yarn run env:stop` or `yarn run wp-env stop` * Restart the environment: `yarn run env` or `yarn run wp-env start` * Reset the dev site's content: `yarn run env:reset && yarn run env:import` +* SSH into docker container: `docker exec -it {container ID} /bin/bash`. You can get the ID from `docker ps`. ### Asset management diff --git a/source/wp-content/themes/wporg-news-2021/functions.php b/source/wp-content/themes/wporg-news-2021/functions.php index 2bbdff69..8af03c45 100644 --- a/source/wp-content/themes/wporg-news-2021/functions.php +++ b/source/wp-content/themes/wporg-news-2021/functions.php @@ -2,8 +2,6 @@ namespace WordPressdotorg\Theme\News_2021; -require_once WPORG_GIT_MUPLUGINS_DIR . '/mu-plugins/blocks/global-header-footer/blocks.php'; - /** * Actions and filters. */