You wrote:
You can use the user_register action to hook into the register proces and then create the user directory with wp_mkdir_p.
function create_user_dir($user_id) { $user_info = get_userdata( $user_id ); $upload_dir = wp_upload_dir(); $user_dir = $upload_dir['basedir'] . '/user_dirs/' . $user_info->user_login; wp_mkdir_p($user_dir); } add_action( 'user_register', 'create_user_dir');
Since I am an absolute beginner with PHP and Wordpress, please WHERE SHOULD I ENTER THE CODE YOU WROTE, EXACTLY ? Which PHP file and which row ? I ask you these questions because I tried to enter the code in wp_insert_user(), in ../wp-includes/user.php, with no result. No folder was created. Please could you help me by indicating the row where I should enter the function. Thank you so much !
Marco