0

I have built a wordpress plugin (wp-content/plugins/MyPlugin) and I would to check some folders permission inside the MyPlugin directory.

My problem is that I don't what Wordpress constant or what PHP function I should use to target on of these directories.

if( !is_writable(WP_PLUGIN_URL.'MyFolder') )
{
    echo 'NOK'.'<hr>';  
}

This piece of code always returns 'NOK' whereas I am 100% sure 'MyFolder' is actually writable .

Can you give me some piece of advice here to get the right file in order to target any folder that would be in my plugin directory?

thanks

1 Answer 1

2

Perhaps WP_PLUGIN_DIR? WP_PLUGIN_URL is responsible for URLs.

1
  • 1
    Thanks, I was able to make it work with: plugin_dir_path(FILE).'MyFolder';
    – Vincent
    Commented Nov 13, 2012 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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