Created
August 9, 2017 13:13
-
-
Save Darklg/5f0e558146ea2416df8ce9b3a1a65b1f to your computer and use it in GitHub Desktop.
Bootstrapping WordPress
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
<?php | |
/* Start in the correct directory */ | |
chdir(dirname(__FILE__)); | |
$bootstrap = 'wp-load.php'; | |
while (!is_file($bootstrap)) | |
/* If there is a parent directory and we are not in the root dir */ | |
if (is_dir('..') && getcwd() != '/') { | |
chdir('..'); | |
} else { | |
die('EN: Could not find WordPress! FR : Impossible de trouver WordPress !'); | |
} | |
} | |
require_once $bootstrap; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment