Is there a WordPress function I can use to create a folder on the server? (3 posts)

  1. harknell
    Posted 9 years ago #

    I'm writing a plugin and would like to be able to have the plugin create a new directory in the wp-content/uploads folder much like WordPress does when an image is uploaded for a post. In my case I want my plugin to tell WordPress to create the folder only once during the activation of the plugin (with of course a check to see if the folder already exists). I've tried to find information on this but can't find if there's a built in function for this, or if I have to code up my own php function to do it (I'd prefer using a built in function of course).

    Is there one?

  2. MichaelH
    Posted 9 years ago #

    Check in the line 1055 area of wp-includes/functions.php for the wp_mkdir_p function. Of course I don't quite see how it works... ;)

  3. harknell
    Posted 9 years ago #

    Thanks for the pointer. I'll look into how it works and probably hook into it somehow.

    If anyone else knows anything else that might help though, that's appreciated too :)

Topic Closed

This topic has been closed to new replies.

About this Topic