Firstly, this is only meant as a how I do it. I’m using MacOS.
It is based on using
git://core.git.wordpress.org/. This would be similar to WP core development on a regular install using the WordPress Beta Tester plugin set for bleeding edge nightlies.
- Create a new site in Local Lightning.
- From Local Lightning Open Site Shell
- You should
- Move the
- Then clone core.git.wordpress.org to
mv ./public/wp-config.php .
rm -rf ./public
git clone git://core.git.wordpress.org/ publicCode language: PHP (php)
Create symlink of
ln -sv $PWD/wp-config.php $PWD/public/wp-config.phpCode language: PHP (php)
The following can be used to keep your clone less cluttered. Add
./app/public/.gitignore with the following data.
Add the above from my gist to the
/app directory with the following command.
curl -o ./public/.gitignore https://gist.githubusercontent.com/afragen/43dfff563e942353d866c81904498cb2/raw/.gitignoreCode language: PHP (php)
setup-phpunit.sh script for testing.
I’ve written a script to aid in applying patches or changesets from core.trac.wordpress.org. It is added to the commands as well.
Update trunk via
git pull from
/app/public using Open Site Shell
Below are the list of sequential commands after Open Site Shell
Someway to automate this setup in a one-click install or an advanced setting on the install would be tremendous. see https://localbyflywheel.com/community/t/feature-request-add-simple-install-of-a-wp-core-dev-environment/12985/3
A separate one-click install using
git://develop.git.wordpress.org/ would also be great but that will require installing
npm and setting the database to display
/build as the home URL endpoint.
As above you will need to create a new site in Local Lightning and then Open Site Shell from Local Lightning.
To make this function, before running the commands you must ensure that your local environment has
npm installed. If you’re on a Mac I highly recommend using Homebrew and
brew install wget. Installing
npm using Homebrew can be done but isn’t necessarily the recommended method.
I had to modify the
setup-phpunit.sh script to work with Local Lightning. It is heavily biased towards using MacOS. I’m hoping I can get a little help making it more universal. My version is on GitHub
Here’s the sequential commands I’ve adapted from Sal’s post to use the
Update for Apple Silicon:
nvm to install node version 16.x. Node v16.x will build on Apple Silicon. The following uses the command line. I have nvm installed via the
zsh-nvm plugin for oh-my-zsh!
nvm install 16, allow a few minutes to build.
nvm use 16
nvm alias default 16, sets node v16.x as default for each new shell session.
This will automatically install and use the correct version of npm.
I have outlined all of the above in a Trac ticket comment.
The preceding bases your WordPress installation on
develop.git.wordpess.org. You will open your site from a URL similar to mylocalsite.local/build/ and the dashboard is mylocalsite.local/build/wp-admin/.
For a one-click install you can use the following commands.
# Setup environment from core.git.wordpress.org
sh -c "$(curl -fsSL https://gist.github.com/afragen/e1aa3ffccf1a73618ee6e756bd95d297/raw/core-git-wp.sh)";cd .
# Setup environment from develop.git.wordpress.org
sh -c "$(curl -fsSL https://gist.github.com/afragen/e1aa3ffccf1a73618ee6e756bd95d297/raw/develop-git-wp.sh)";cd .Code language: PHP (php)