0

I'm having a a pain in the head using the ABSPATH constant in Windows.
Addressing files and folders in Windows is usually done using the \ (forward-slash) character while for Linux the character would be / (backslash).
Unfortunately the ABSPATH in Wordpress is defined with only Linux in mind (putting a / at the end of it).
I wonder if I can over-ride it's definition since in wp-config.php it's defined under an if clause which indicates it can be defined elsewhere.

Problem detalis:

  1. I'm running on localhost
  2. The problem is with the statpress-visitors internal addressing.

This is how it addresses the files:

ABSPATH . 'wp-content/plugins/' . dirname(plugin_basename(__FILE__)) . '/def/os.dat'

And this is what I get as output:

C:\wamp\www\wp/wp-content/plugins/statpress-visitors/def/os.dat
1
  • Could you elaborate some more on 2 ? Can it be narrowed down to specific place / function in plugin that fails? – Rarst Feb 7 '12 at 11:35
1

Windows does support both styles of slashes in path.

I am not sure if ABSPATH definition is safe to edit:

  • pro it's in wp-config.php
  • con it's says to not edit following above it

Myself I just use it as is, or replace slashes to make them uniform when putting path together. If that doesn't work for you please provide specific examples where this causes issues.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.