Public
Authored by Simone

#WORDPRESS #PHP custom upload directory

Edited
$upload_dir   = wp_upload_dir();

$dir = $upload_dir['basedir'] .'/my-upload-folder/';

if ( ! file_exists( $dir ) ) {
    $path_created = wp_mkdir_p( $dir );
    if (!$path_created) {
        echo 'Error creating directories. check folder permission.';
    }
}
custom upload directory 261 Bytes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment