WordPress plugin access to folder one level up

I have two plugins installed one that makes uploads in the wp-content/uploads folder and the other is a simple table. I am modifying the table in order to read the number of files inside uploads folder. As you know that makes the plugins and uploads on the same level. I used content_url("/uploads/"); to access it but there is more to it. Here is my simple code:

 $dir = content_url("/uploads/");

    if (is_dir($dir)) 
    {
        foreach(glob($dir) as $file) 
        {
            echo filetype($file) . "<br />";
        }
    }

The question is how can i access the uploads folder from my plugin?

Read More

Thanks

Related posts

Leave a Reply

1 comment