我在这里收到missing argument
错误。有什么想法吗?
function my_approve( $user_id, $user_login, $user_password, $user_email, $usermeta ) {
// Send the email notification.
wp_mail( $user_email, $user_login . ' Yay', 'you have been approved' );
}
add_action( 'bp_core_activated_user', 'my_approve', 10, 5 );
答案 0 :(得分:0)
与bp_core_activated_user
相关联的功能应仅接受3个参数:$user_id
,$key
和$user
。所以你的代码应该是这样的:
function my_approve( $user_id, $key, $user ) {
wp_mail( $user->user_email, $user->user_login . ' Yay', 'you have been approved' );
}
add_action( 'bp_core_activated_user', 'my_approve', 10, 3 );