Change a plugins upload directory to another directory
-
Hi guys
I have developed a plugin called react-xmpl which i am sturggling with.
I have a settings page with upload dialogue, it succesfuly uploads any file, but into the default upload directory.In order for this plugin to function properly i need to change the default directory to upload directly into the parents plugins folder.
like this: wp-content/plugins/react-xmpl/
This must be applied only for this plugin and not globaly.code i have tried so far is the following:
function wpse_183245_upload_dir( $dirs ) { $dirs['subdir'] = '/abc'; $dirs['path'] = $dirs['basedir'] . '/abc'; $dirs['url'] = $dirs['baseurl'] . '/abc'; return $dirs; }
Any help would be appreciated.
regards
Matt
- The topic ‘Change a plugins upload directory to another directory’ is closed to new replies.