WP File Manager – Codex Doc

All files are saved as custom post types nm-userfiles and uploaded file is attached as post attachment. All directories are also custom posts but without any attachment.

[vcex_heading text=”Action/Filters with Examples” font_size=”25px”]

Example:

add_filter('fileupload_from_email', 'change_from_email');
function change_from_email($dedault_email){
return 'any@otheremail.com';
}

add_filter(‘fileupload_subject’)

Change Subject

  • Notification when file uploaded by user

Example:

add_filter('fileupload_subject', 'change_subject', 10, 2);
function change_subject($dedault_subject, $file_name){

	return 'A new file ' . $file_name . ' is uploaded ';
}

add_filter(‘fileupload_receivers’)

Change Recipients

  • Notification when file uploaded by user
  • Receivers – Array

Example:

add_filter('fileupload_receivers', 'change_receivers');
function change_receivers($dedault_receivers){

	$dedault_receivers[] = 'new@email.com';
	return $dedault_receivers;
}

add_filter(‘fileupload_message’)

Change Email Message (Body) 

  • Notification when file uploaded by user
  • $file_data – Array with following keys
  • title
  • filename
  • file_meta (key, value)

Example:

add_filter('fileupload_message', 'change_message', 10, 2);
function change_message($message, $args){

	$file_meta = '';
	if($args){
		foreach($args['file_meta'] as $key => $val){
			$file_meta .= $key .': '.$val.'
';
		}
	$message .= '
' . $file_meta;
	}

	return $message;
}

WP Front-end File Upload and Download Manager

WP Front end File Upload and Download Manager plugin allow users to upload files, create directories using most secure Upload script. Each user can manage his file privately. Admin can access all files from admin. Nice and simple UI to manage files and directories and much more.