add_action doesn’t work for my function

HI please check below code. add_action( ‘user_register’, ‘fill_identity’, 10, 1 ); function fill_identity($user_id){ $current_user = get_userdata($user_id); $mail_user = $current_user->user_email; $mail_user = substr($mail_user,0,-14); $mail_user = explode(“.”, $mail_user); $prenom = $mail_user[0] = ucfirst($mail_user[0]); $nom = $mail_user[1] = ucfirst($mail_user[1]); var_dump($mail_user); wp_update_user(array( ‘ID’ => $current_user->ID, ‘first_name’ => $prenom, ‘last_name’ => $nom, )); }

How can I fetch user registration age

Solved the above task, posting the answer here so that someone can use the code I added this code in functions.php function is_user_video_perweek( $reg_days_ago ) { $currentuser = wp_get_current_user(); return ( isset( $currentuser->data->user_registered ) && strtotime( $currentuser->data->user_registered ) < strtotime( sprintf( ‘-%d days’, $reg_days_ago ) ) ); } and then in footer.php I called this … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)