Wordpress buddypress:缺少参数错误

时间:2014-07-29 11:59:09

标签: php wordpress wordpress-plugin buddypress

我在这里收到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 );

1 个答案:

答案 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 );
相关问题