Description
Allows you to filter the settings for the user upload directory when using a file or image upload field.
The default directory will be /wpmembers/user_files/{user id}/ in your main uploads directory (usually /wp-content/uploads/).
Parameters
$args
(array) (required) An array of arguments that make up the user upload directory.
Defaults:
Usage
This filter can be used to make changes to the directory a user uploaded file will be stored in. One of the parameters in the array is the $user_id so you can change directories based on the user ID. The sub directories are option in a sense, but one is not used, you must return the array key with an empty value. Also, the wpmem_dir subdirectory should have a trailing slash, but not leading slash (i.e. $args[‘wpmem_dir’] should be “directory_name/” not “/directory_name”). The user_dir subdirctory should likewise not contain a leading slash. The final directory in the user_dir subdirectory should not have a trailing slash ( i.e. $args[‘user_dir’] should be “user_dir/some_directory/someother_sub” but not “/user_dir/some_directory/someother_sub/”)
Changelog
Added in version 3.1.0
Source
wpmem_user_upload_dir is located in inc/class-wp-members-forms.php