2012-06-04 3 views
0

사용자가 "Country"또는 "City"의 프로파일 필드를 새 값으로 업데이트하면 새 값이있는 필드 만 알려주고 싶습니다. Curently 나는 이것을 사용하고 있지만 fiels이 수정 된 어떤 얘기하지 않습니다필드에 buddypress xprofile의 새 값이 있는지 확인하십시오.

여기
function update_xprofile_country_state($user_id) { 
    if (!empty($user_id)) { 
      $user = new WP_User ($user_id); 
     if (!empty($_POST['country'])) { 
       wp_mail ('[email protected]', 'Subject (' . $user->user_login . ' just updated the Profile)', 'Message Body goes here.'); 
     } 
    } 
} 
add_action('xprofile_updated_profile', 'update_xprofile_country_state', 0, 1); 

당신이 가지고 :

답변

0

코드 아래 사용하세요 ..

add_action ('xprofile_updated_profile', 'profile_change_notify'); 
function profile_change_notify ($vars = array()) 
{ 
    $user = new WP_User ($vars['user_id']); 
    wp_mail ('[email protected]', 'Subject (' . $user->user_login . ' just updated the Profile)', 'Message Body goes here.'); 
} 

내가 어떤 도움을 주셔서 감사합니다 $ _POST 변수의 값. 컨텍스트 값이 사용자 프로필에서 업데이트 된 경우 메일을 보냅니다.