WordPress triggers a custom hook when certain meta is updated, user meta counts. See updated_{$meta_type}_meta
. Here’s an example use case:
add_action('updated_user_meta', function( $meta_id, $user_id, $meta_key, $_meta_value ) {
switch ( $meta_key ) {
case 'mobile_number':
case 'address':
$user = new \WP_User($user_id);
// user
wp_mail($user->user_email, 'Profile updated', 'Profile updated.');
// admin
wp_mail(get_bloginfo('admin_email'), 'Profile updated', "Profile updated for user {$user->display_name}.");
break;
}
}, 0, 4);
Related Posts:
- How to login with email only no username?
- Separate registration and login for different roles
- Disallow user from editing their own profile information
- What are the differences between wp_users and wp_usermeta tables?
- How can I send a welcome email to a user AFTER they login for the first time?
- Customize wp_new_user_notification_email()
- Login email after registration never sent or received
- Display sortable User meta column in admin panel user’s page
- Restricting frontend acess based on user role otherwise redirect to login form
- Right practice to edit WP reset password email
- Deny a user role to log in after register
- Private page protected with username and password
- How to integrate external user tables with WP?
- Allow Users Only Edit Their Profile?
- How can I change the email sender name from wordpress to (myblogname) on the “lost password” email?
- Set Default User Role
- Lock out all WordPress Administrators except two specific users
- Can’t log in. WordPress says my account doesn’t exist [closed]
- Why is wp-login trying to send an email?
- Invalidate username if it contains @ symbol
- WordPress Login redirection according to user role
- Prevent Subscriber Role to login
- Sending new registration meta values to admin by email
- Can I protect a type of content site-wide with a single password?
- Log in with email but no password
- How are all users now set to inactive?
- Login Based on ip
- How is it possible to current user info on page in WordPress?
- URL Restrictions? Need only people who are logged in AND have a specific role (or roles) to access all pages for a site
- Updated : how to make email optional while user registration using default wordpress form
- Custom failed login error messages for users based on user role?
- Custom user roles are unable to login
- WordPress does not send email confirmation to newly registered users
- confirmation email is send from my local host registration of a user but mail will not display in there email account?
- Check to see if there a wordpress user account and create one if not outside of wordpress
- Can i login with only one account to different top leveled domain wordpress web sites?
- Cant login, Password MUST be reset error, after reset
- Can I programmatically login a user without a password?
- Removing username from the ‘wordpress_logged_in’ cookie
- Check if user is admin by user ID
- Woocommerce registration page [closed]
- Share login data/cookies between multiple installations
- Is it possible to sign in with user_email in WordPress?
- Email address or username used to login in wordpress
- How to loop through each user id?
- Ordering users of a specific role by last name
- how to add custom user capabilities using add_user_meta or something else?
- How to add usermeta to “Notice of Email Change” email message
- How to customise wp-login.php only for users who are setting a password for the first time?
- Login redirect_to loop with reauth=1, cookie expiry set to 1 year in past
- User Login Form Outside the Default wp-login Form
- I am not able to login to my wp-admin panel
- Block Logged-Out User Access to Directory Outside of WordPress using .htaccess and PHP file
- how to logout user on browser tab or window closes
- Making a client page
- Auto login user with link from Mail
- To be able to login as different user
- WordPress missing user roles on local dev machine. Live site works fine
- How do I Create Forums with bbpress Plugin that can only be Viewed by Logged in Users
- How to redirect to specific BLOG Dashboard (after login to Multi-Site)
- Are User Levels Still Currently Used?
- Is possible to allow user to login with different role?
- Login again after profile update
- Redirect wp-login
- Auto Login After Registration
- Changed Wordress Address URL Accidently
- WordPress login security
- Why isn’t the login page rate limited by default?
- Input sanitation
- One account with multiple logins
- Single Time Login HELP
- Allow Access to Home Page and Login Screen but Nothing Else (unless logged in)
- Reloading page with a query string upon login for admins
- force login loophole
- Custom login page problem!
- Looking up WordPress account information from Host or php files
- Multiple issues with Ajax login function due to browsers and cookies
- URL with login details included for public members
- woocommerce store login not working at first time
- Trouble when I try to connect to WordPress
- Recognize custom login page as wp-login.php
- Set logged in user based on API response
- Updating user meta data from external link, user not logged in
- Can’t login to wordpress, got ERR_EMPTY_RESPONSE after a few minutes
- wp_signon works localhost but not wokrs https site
- How to Enable registration email for a custom user role?
- Allow log in to the dashboard only from specific gadget?
- Why deleting/removing cookies in WordPress does not log me out from admin?
- How to use google api for wordpress login
- Can we start session from another php site to wordpress blog site?
- display last login date in the frontend
- Log in to wordpress after executing another form function
- WordPress keeps redirecting to an unsecure connection?
- A way to redirect users when they log in based on their current page
- changing WordPress login page
- Where do I find “log in” and “register” link which are located on the top right corner?
- How to make WordPress keep me signed in? [duplicate]
- how to add custom word press regisration form in word press 3.5 with out module [closed]
- Login and register by API
- Log in a user upon password reset?