Delete (custom) users folder in media directory
-
Hi,
First of all I’d like to thank you for building this awesome plugin, it really solves big things!
Here is one feature request.
I am using the following code to differentiate uploads by user (each user is being assigned it’s own folder where his uploads are stored).
My problem is that once I use the “delete me” function I am left with an empty user folder in the main uploads dir. Is there any way to hook a function that will check for those folders and delete them too?
Thanks a ton!
/* Per user upload dir function */ function per_user_upload_dir( $original ){ // use the original array for initial setup $modified = $original; // set our own replacements if ( is_user_logged_in() ) { $current_user = wp_get_current_user(); $subdir = $current_user->user_login; $modified['subdir'] = $subdir; $modified['url'] = $original['baseurl'] . '/' . $subdir; $modified['path'] = $original['basedir'] . DIRECTORY_SEPARATOR . $subdir; } return $modified; } add_filter( 'upload_dir', 'per_user_upload_dir');
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Delete (custom) users folder in media directory’ is closed to new replies.