Determining wordpress installation directory
-
Is there any standard way to determine the wordpress directory from php?
I am writing a plugin that needs to use a URL version of that directory. To require_once wp-config I use the ABSPATH constant:
require_once(ABSPATH . ‘wp-config.php’);
but ABSPATH yields a non-URL path.
I found some php code in another plugin that looks like this:
$site_root = parse_url(get_settings('siteurl')); $site_root = trailingslashit($site_root['path']);But those functions require that wp-config already has been run. Any other suggestions?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Determining wordpress installation directory’ is closed to new replies.