Unique ID Generation
-
In this code, the user is getting a unique code with a prefix “C”, I want to add a condition in it, if a person selects their gender as “Male”, the Unique ID should have prefix “CM”, and if selects “Female”, it should be “CF”. How can I achieve this?
add_action("user_register","um_012022_generate_unique_account_id"); function um_012022_generate_unique_account_id( $user_id ) { $unique_account_id = 'C-' . str_pad( $user_id, 5, '0', STR_PAD_LEFT ); update_user_meta( $user_id, "um_unique_account_id", $unique_account_id ); }
Thank you,
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Unique ID Generation’ is closed to new replies.