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
cd .. mv ./public/wp-config.php . rm -rf ./public git clone git://core.git.wordpress.org/ public
Create symlink of
ln -sv $PWD/wp-config.php $PWD/public/wp-config.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/.gitignore
setup-phpunit.sh script for testing.
curl -o setup-phpunit.sh https://raw.githubusercontent.com/afragen/setup-phpunit/master/setup-phpunit.sh
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.
curl -o apply-trac-patch.sh https://gist.githubusercontent.com/afragen/977d765414189d5f5fae42215fe92a27/raw/apply-trac-patch.sh
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 would also likely 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
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 .