Whilst writing some code that backs-up a plugin, I hit a problem with ‘the wrong kind of directory slash’ on my windows dev environment.
Tracking it through I find in default-constants.php:91
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
which is based on the following in default-constants.php:46
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
and hence to the config file definition…
define('ABSPATH', dirname(__FILE__) . "https://wordpress.stackexchange.com/");
So my question is:
Q. Why are both ABSPATH and WP_CONTENT_DIR, which are intrinsically file system specific (ie can’t be interpreted for URL’s), definied using explicit forward slashes, rather than PHP’s own DIRECTORY_SEPARATOR ?