当新用户在wordpress上注册时,如何运行自定义php代码



当新用户在wordpress上注册时,我如何运行自定义php代码?

我试图在新用户注册后向管理员发送短信。我知道如何发送短信,只是不确定把代码放在哪里。

我已经安装了php代码段。

您可以使用user_register操作挂钩,该挂钩在注册新用户后立即启动。

function myfunction_after_registration( $user_id ) {
// send your SMS to the admin about $user_id
}
add_action( 'user_register', 'myfunction_after_registration', 10, 1 );

我将在functions.php中添加这一点;php片段";你指的是

参考

最新更新