Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Perhaps WP_PLUGIN_DIR? WP_PLUGIN_URL is responsible for URLs.

share|improve this answer
1  
Thanks, I was able to make it work with: plugin_dir_path(FILE).'MyFolder'; –  Vincent Nov 13 '12 at 22:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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