Created
March 10, 2019 00:31
-
-
Save campaignupgrade/3ea1f4b56822670be7743b9db12cc1df to your computer and use it in GitHub Desktop.
Finds WordPress root from any subdirectory in the WordPress install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while [ ! -e wp-config.php ]; do | |
if [ $pwd/ = / ]; then | |
echo "No Wordpress root found" >&2; exit 1 | |
fi | |
cd ../ | |
done | |
if [ -e wp-config.php ]; then | |
wproot=$(pwd) | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment