Hi, yes it can be done with a plugin hook. Here is an example:
if (!function_exists('wfu_before_upload_handler')) {
function wfu_before_upload_handler($changable_data, $additional_data) {
$limit = 1;
$user = wp_get_current_user();
if ( $user->ID != 0 ) {
$filerecs = wfu_get_recs_of_user($user->ID);
if ( count($filerecs) >= $limit )
$changable_data["error_message"] = "File rejected. Maximum upload limit reached.";
}
return $changable_data;
}
add_filter('wfu_before_upload', 'wfu_before_upload_handler', 10, 2);
}
Set $limit to the value you want. I a user tries to upload more files, an error message will be shown.
You need to put it in functions.php file of your theme.
Regards
Nickolas
Thank you Nickolas, works like a charm!