Filter Hook: user_meta_pre_user_register
This filter can be used to modify/add user data before user registration. Custom validation before user registration is possible.
Parameters: $userData (array)
Example
More validation before user register
add_filter( 'user_meta_pre_user_register', 'user_meta_pre_user_register_function' ); function user_meta_pre_user_register_function( $userData ){ // Write your code for more validation before user register. // return WP_Error object if there are any error or validation failed. return $userData; }
Add more extra data to usermeta table
add_filter( 'user_meta_pre_user_register', 'user_meta_pre_user_register_function' ); function user_meta_pre_user_register_function( $userData ){ // You can add some conditionl metadata $userData[ 'new_meta_key' ] = 'New Meta Value'; return $userData; }
Change Log: Since 1.1.2