wordpress - check if field has new value in buddypress xprofile -


when user updates profile field "country" or "city" new value, want notified field has new value. curently i'm using doesn't tell fiels have been modified:

add_action ('xprofile_updated_profile', 'profile_change_notify'); function profile_change_notify ($vars = array ()) {     $user = new wp_user ($vars['user_id']);     wp_mail ('myname@mydomain.com', 'subject ( ' . $user->user_login . ' updated profile )', 'message body goes here.'); } 

i appreciate help..

please use below code:

function update_xprofile_country_state($user_id) {     if (!empty($user_id)) {             $user = new wp_user ($user_id);         if (!empty($_post['country'])) {                  wp_mail ('myname@mydomain.com', 'subject ( ' . $user->user_login . ' updated profile )', 'message body goes here.');         }     } } add_action('xprofile_updated_profile', 'update_xprofile_country_state', 0, 1); 

here have got value $_post variable. if contry value updated user profile send mail.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -