• Hi, I used this code to change default directory in which ultimate member document uploaded files, but after the last update it doesn’t work anymore and files are always uploaded in a dir /um_docs/filename/. I tried using the filter um_upload_basedir_filter but does not work. How I can change file upload directory? http://hookr.io/filters/um_upload_basedir_filter/

    add_filter('upload_dir', 'caf_documents_dir');
    function caf_documents_dir( $param ){
    	if (isset( $_POST['um_document_nonce'] )) {
    	    $first_name=preg_replace("/[^A-Za-z ]/", '', um_user('first_name'));
    	    $mydir = '/cafdoc/'.$first_name.'_'.date('Y'); 		
    	    $param['path'] = '/web/htdocs/mywebsite/home/wp-content/uploads/' . $mydir;
    	    $param['url'] = $param['url'] . $mydir;
    	    return $param;
    	}
    	
       return $param;
    }

The topic ‘Change default directory for files’ is closed to new replies.